@gearbox-protocol/sdk 14.11.16 → 14.11.17

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.
@@ -237,17 +237,16 @@ class BytecodeRepositoryContract extends import_sdk.BaseContract {
237
237
  authorSignature: uploadData.authorSignature
238
238
  };
239
239
  }
240
+ case "deploy": {
241
+ const [contractType, version, constructorParams, salt] = params.args;
242
+ return {
243
+ contractType: (0, import_viem.hexToString)(contractType, { size: 32 }),
244
+ version: version.toString(),
245
+ constructorParams,
246
+ salt: (0, import_viem.hexToString)(salt, { size: 32 })
247
+ };
248
+ }
240
249
  // TODO: add all functions here!
241
- // case "deployContract": {
242
- // const [contractType, version, encodedParams, salt, owner] = params.args;
243
- // return this.wrapParseCall(params, {
244
- // contractType: hexToString(contractType, { size: 32 }),
245
- // version: version.toString(),
246
- // encodedParams,
247
- // salt,
248
- // owner,
249
- // });
250
- // }
251
250
  // case "setContractTypeVersion": {
252
251
  // const [contractType, version] = params.args;
253
252
  // return this.wrapParseCall(params, {
@@ -25,18 +25,25 @@ var import_viem = require("viem");
25
25
  var import_utils = require("viem/utils");
26
26
  var import_governor = require("../../../abi/governance/governor.js");
27
27
  var import_sdk = require("../../../sdk/index.js");
28
+ var import_addresses = require("../../deployment/addresses.js");
29
+ var import_bytecode_repository = require("../bytecode-repository.js");
28
30
  var import_market_configurator = require("../market-configurator.js");
29
31
  var import_treasury_splitter = require("../treasury-splitter.js");
30
32
  var import_batches_chain = require("./batches-chain.js");
31
33
  const abi = import_governor.governorAbi;
32
34
  class GovernorContract extends import_sdk.BaseContract {
33
35
  batchesChainContract;
36
+ bcr;
34
37
  constructor(addr, client) {
35
38
  super({ client }, { abi, addr, name: "Governor" });
36
39
  this.batchesChainContract = new import_batches_chain.BatchesChainContract(
37
40
  "0x59b2fd348e4Ade84ffEfDaf5fcdDa7276c8C5041",
38
41
  client
39
42
  );
43
+ this.bcr = new import_bytecode_repository.BytecodeRepositoryContract(
44
+ import_addresses.Addresses.BYTECODE_REPOSITORY,
45
+ client
46
+ );
40
47
  }
41
48
  getTxHash(tx) {
42
49
  if (tx.contractMethod.name !== "queueTransaction") {
@@ -145,6 +152,9 @@ class GovernorContract extends import_sdk.BaseContract {
145
152
  case this.batchesChainContract.address.toLowerCase(): {
146
153
  return this.batchesChainContract.parseFunctionData(calldata);
147
154
  }
155
+ case this.bcr.address.toLowerCase(): {
156
+ return this.bcr.parseFunctionData(calldata);
157
+ }
148
158
  default: {
149
159
  try {
150
160
  let parsedData;
@@ -36,6 +36,7 @@ var import_compressors = require("./compressors/index.js");
36
36
  var import_price_feed_store = require("./price-feed-store.js");
37
37
  var import_router = require("./router/index.js");
38
38
  var import_treasury_splitter = require("./treasury-splitter.js");
39
+ var import_bytecode_repository = require("./bytecode-repository.js");
39
40
  const abi = import_instanceManager.instanceManagerAbi;
40
41
  class InstanceManagerContract extends import_sdk.BaseContract {
41
42
  constructor(addr, register) {
@@ -51,6 +52,10 @@ class InstanceManagerContract extends import_sdk.BaseContract {
51
52
  const priceFeedStore = new import_price_feed_store.PriceFeedStoreContract(target, this.client);
52
53
  return priceFeedStore.parseFunctionData(calldata);
53
54
  }
55
+ case import_addresses.Addresses.BYTECODE_REPOSITORY.toLowerCase(): {
56
+ const bcr = new import_bytecode_repository.BytecodeRepositoryContract(target, this.client);
57
+ return bcr.parseFunctionData(calldata);
58
+ }
54
59
  default: {
55
60
  try {
56
61
  let parsedData;
@@ -27,6 +27,7 @@ var Addresses = /* @__PURE__ */ ((Addresses2) => {
27
27
  Addresses2["PRICE_FEED_STORE"] = "0x74A868AC479EE145029bB80827BB77F7B7c441cB";
28
28
  Addresses2["IO_PROXY"] = "0xBcD875f0D62B9AA22481c81975F9AE1753Fc559A";
29
29
  Addresses2["INSTANCE_MANAGER"] = "0x77777777144339Bdc3aCceE992D8d4D31734CB2e";
30
+ Addresses2["BYTECODE_REPOSITORY"] = "0x1cE2B1BE96a082b1b1539F80d5D8f82Ec06a0f9A";
30
31
  return Addresses2;
31
32
  })(Addresses || {});
32
33
  // Annotate the CommonJS export names for ESM import in node:
@@ -220,17 +220,16 @@ class BytecodeRepositoryContract extends BaseContract {
220
220
  authorSignature: uploadData.authorSignature
221
221
  };
222
222
  }
223
+ case "deploy": {
224
+ const [contractType, version, constructorParams, salt] = params.args;
225
+ return {
226
+ contractType: hexToString(contractType, { size: 32 }),
227
+ version: version.toString(),
228
+ constructorParams,
229
+ salt: hexToString(salt, { size: 32 })
230
+ };
231
+ }
223
232
  // TODO: add all functions here!
224
- // case "deployContract": {
225
- // const [contractType, version, encodedParams, salt, owner] = params.args;
226
- // return this.wrapParseCall(params, {
227
- // contractType: hexToString(contractType, { size: 32 }),
228
- // version: version.toString(),
229
- // encodedParams,
230
- // salt,
231
- // owner,
232
- // });
233
- // }
234
233
  // case "setContractTypeVersion": {
235
234
  // const [contractType, version] = params.args;
236
235
  // return this.wrapParseCall(params, {
@@ -11,18 +11,25 @@ import {
11
11
  formatTimestamp,
12
12
  json_stringify
13
13
  } from "../../../sdk/index.js";
14
+ import { Addresses } from "../../deployment/addresses.js";
15
+ import { BytecodeRepositoryContract } from "../bytecode-repository.js";
14
16
  import { MarketConfiguratorContract } from "../market-configurator.js";
15
17
  import { TreasurySplitterContract } from "../treasury-splitter.js";
16
18
  import { BatchesChainContract } from "./batches-chain.js";
17
19
  const abi = governorAbi;
18
20
  class GovernorContract extends BaseContract {
19
21
  batchesChainContract;
22
+ bcr;
20
23
  constructor(addr, client) {
21
24
  super({ client }, { abi, addr, name: "Governor" });
22
25
  this.batchesChainContract = new BatchesChainContract(
23
26
  "0x59b2fd348e4Ade84ffEfDaf5fcdDa7276c8C5041",
24
27
  client
25
28
  );
29
+ this.bcr = new BytecodeRepositoryContract(
30
+ Addresses.BYTECODE_REPOSITORY,
31
+ client
32
+ );
26
33
  }
27
34
  getTxHash(tx) {
28
35
  if (tx.contractMethod.name !== "queueTransaction") {
@@ -131,6 +138,9 @@ class GovernorContract extends BaseContract {
131
138
  case this.batchesChainContract.address.toLowerCase(): {
132
139
  return this.batchesChainContract.parseFunctionData(calldata);
133
140
  }
141
+ case this.bcr.address.toLowerCase(): {
142
+ return this.bcr.parseFunctionData(calldata);
143
+ }
134
144
  default: {
135
145
  try {
136
146
  let parsedData;
@@ -20,6 +20,7 @@ import { WithdrawalCompressorContract } from "./compressors/index.js";
20
20
  import { PriceFeedStoreContract } from "./price-feed-store.js";
21
21
  import { RoutingManagerContract } from "./router/index.js";
22
22
  import { TreasurySplitterContract } from "./treasury-splitter.js";
23
+ import { BytecodeRepositoryContract } from "./bytecode-repository.js";
23
24
  const abi = instanceManagerAbi;
24
25
  class InstanceManagerContract extends BaseContract {
25
26
  constructor(addr, register) {
@@ -35,6 +36,10 @@ class InstanceManagerContract extends BaseContract {
35
36
  const priceFeedStore = new PriceFeedStoreContract(target, this.client);
36
37
  return priceFeedStore.parseFunctionData(calldata);
37
38
  }
39
+ case Addresses.BYTECODE_REPOSITORY.toLowerCase(): {
40
+ const bcr = new BytecodeRepositoryContract(target, this.client);
41
+ return bcr.parseFunctionData(calldata);
42
+ }
38
43
  default: {
39
44
  try {
40
45
  let parsedData;
@@ -4,6 +4,7 @@ var Addresses = /* @__PURE__ */ ((Addresses2) => {
4
4
  Addresses2["PRICE_FEED_STORE"] = "0x74A868AC479EE145029bB80827BB77F7B7c441cB";
5
5
  Addresses2["IO_PROXY"] = "0xBcD875f0D62B9AA22481c81975F9AE1753Fc559A";
6
6
  Addresses2["INSTANCE_MANAGER"] = "0x77777777144339Bdc3aCceE992D8d4D31734CB2e";
7
+ Addresses2["BYTECODE_REPOSITORY"] = "0x1cE2B1BE96a082b1b1539F80d5D8f82Ec06a0f9A";
7
8
  return Addresses2;
8
9
  })(Addresses || {});
9
10
  export {
@@ -1,6 +1,7 @@
1
1
  import { type Address, type Chain, type DecodeFunctionDataReturnType, type Hash, type PublicClient, type Transport } from "viem";
2
2
  import type { ParsedCallArgs, RawTx } from "../../../sdk/index.js";
3
3
  import { BaseContract } from "../../../sdk/index.js";
4
+ import { BytecodeRepositoryContract } from "../bytecode-repository.js";
4
5
  import { BatchesChainContract } from "./batches-chain.js";
5
6
  import type { SafeTx } from "./types.js";
6
7
  declare const abi: readonly [{
@@ -590,6 +591,7 @@ declare const abi: readonly [{
590
591
  export declare class GovernorContract extends BaseContract<typeof abi> {
591
592
  #private;
592
593
  readonly batchesChainContract: BatchesChainContract;
594
+ readonly bcr: BytecodeRepositoryContract;
593
595
  constructor(addr: Address, client: PublicClient<Transport, Chain>);
594
596
  getTxHash(tx: RawTx): Hash;
595
597
  owner(): Promise<Address>;
@@ -3,5 +3,6 @@ export declare enum Addresses {
3
3
  ZERO_PRICE_FEED = "0x5dC92eC92cd5423EF95aEbe8Ac96619BCc9ffC88",
4
4
  PRICE_FEED_STORE = "0x74A868AC479EE145029bB80827BB77F7B7c441cB",
5
5
  IO_PROXY = "0xBcD875f0D62B9AA22481c81975F9AE1753Fc559A",
6
- INSTANCE_MANAGER = "0x77777777144339Bdc3aCceE992D8d4D31734CB2e"
6
+ INSTANCE_MANAGER = "0x77777777144339Bdc3aCceE992D8d4D31734CB2e",
7
+ BYTECODE_REPOSITORY = "0x1cE2B1BE96a082b1b1539F80d5D8f82Ec06a0f9A"
7
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "14.11.16",
3
+ "version": "14.11.17",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "repository": {