@gearbox-protocol/sdk 17.10.1 → 17.11.0

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.
Files changed (112) hide show
  1. package/dist/cjs/offchain/AbstractOffchainNamespace.js +31 -8
  2. package/dist/cjs/permissionless/api/GearboxPermissionless.js +79 -0
  3. package/dist/cjs/permissionless/api/chains/ChainsNamespace.js +180 -0
  4. package/dist/cjs/permissionless/api/chains/index.js +4 -0
  5. package/dist/cjs/permissionless/api/chains/schemas.js +34 -0
  6. package/dist/cjs/permissionless/api/chains/types.js +1 -0
  7. package/dist/cjs/permissionless/api/deploy/PermissionlessDeploy.js +152 -0
  8. package/dist/cjs/permissionless/api/deploy/effective-staleness.js +46 -0
  9. package/dist/cjs/permissionless/api/deploy/index.js +8 -0
  10. package/dist/cjs/permissionless/api/deploy/types.js +1 -0
  11. package/dist/cjs/permissionless/api/errors.js +82 -0
  12. package/dist/cjs/permissionless/api/index.js +28 -0
  13. package/dist/cjs/permissionless/api/oracles/PermissionlessOracles.js +84 -0
  14. package/dist/cjs/permissionless/api/oracles/index.js +6 -0
  15. package/dist/cjs/permissionless/api/oracles/schemas.js +64 -0
  16. package/dist/cjs/permissionless/api/oracles/types.js +1 -0
  17. package/dist/cjs/permissionless/api/schemas.js +28 -0
  18. package/dist/cjs/permissionless/api/transactions/InstanceOwnerTransactions.js +230 -0
  19. package/dist/cjs/permissionless/api/transactions/index.js +4 -0
  20. package/dist/cjs/permissionless/api/transactions/lp-price-feeds.js +86 -0
  21. package/dist/cjs/permissionless/api/transactions/types.js +1 -0
  22. package/dist/cjs/permissionless/api/types.js +1 -0
  23. package/dist/cjs/permissionless/bindings/cross-chain-multisig.js +1 -1
  24. package/dist/cjs/permissionless/bindings/index.js +3 -3
  25. package/dist/cjs/permissionless/bindings/instance-manager.js +3 -3
  26. package/dist/cjs/permissionless/index.js +31 -8
  27. package/dist/cjs/permissionless/utils/governance/timelock-txs.js +1 -1
  28. package/dist/cjs/permissionless/utils/index.js +4 -4
  29. package/dist/cjs/permissionless/utils/price-update/get-price-update-tx.js +1 -1
  30. package/dist/cjs/permissionless/utils/price-update/index.js +1 -1
  31. package/dist/esm/dev/AccountOpener.js +1 -1
  32. package/dist/esm/dev/withdrawalUtils.js +1 -1
  33. package/dist/esm/history/trace/extractTransfers.js +1 -1
  34. package/dist/esm/offchain/AbstractOffchainNamespace.js +31 -8
  35. package/dist/esm/onchain/accounts/CreditAccountsServiceV310.js +2 -2
  36. package/dist/esm/onchain/accounts/liquidations/LiquidationsService.js +1 -1
  37. package/dist/esm/onchain/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.js +1 -1
  38. package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.js +1 -1
  39. package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.js +1 -1
  40. package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +1 -1
  41. package/dist/esm/onchain/base/TokensMeta.js +3 -3
  42. package/dist/esm/onchain/core/createAddressProvider.js +1 -1
  43. package/dist/esm/onchain/market/adapters/contracts/AccountMigratorAdapterContract.js +1 -1
  44. package/dist/esm/onchain/market/adapters/contracts/ERC4626AdapterContract.js +1 -1
  45. package/dist/esm/onchain/market/credit/CreditFacadeV310BaseContract.js +1 -1
  46. package/dist/esm/onchain/market/pool/PoolV310Contract.js +1 -1
  47. package/dist/esm/onchain/market/rwa/createDegenNFT.js +1 -1
  48. package/dist/esm/onchain/market/zapper/IETHZapperContract.js +1 -1
  49. package/dist/esm/onchain/market/zapper/ZapperContract.js +1 -1
  50. package/dist/esm/onchain/preview/preview/previewPoolPositionOperation.js +2 -2
  51. package/dist/esm/onchain/utils/viem/simulateWithPriceUpdates.js +1 -1
  52. package/dist/esm/permissionless/api/GearboxPermissionless.js +78 -0
  53. package/dist/esm/permissionless/api/chains/ChainsNamespace.js +179 -0
  54. package/dist/esm/permissionless/api/chains/index.js +3 -0
  55. package/dist/esm/permissionless/api/chains/schemas.js +30 -0
  56. package/dist/esm/permissionless/api/chains/types.js +1 -0
  57. package/dist/esm/permissionless/api/deploy/PermissionlessDeploy.js +149 -0
  58. package/dist/esm/permissionless/api/deploy/effective-staleness.js +46 -0
  59. package/dist/esm/permissionless/api/deploy/index.js +4 -0
  60. package/dist/esm/permissionless/api/deploy/types.js +1 -0
  61. package/dist/esm/permissionless/api/errors.js +77 -0
  62. package/dist/esm/permissionless/api/index.js +13 -0
  63. package/dist/esm/permissionless/api/oracles/PermissionlessOracles.js +81 -0
  64. package/dist/esm/permissionless/api/oracles/index.js +3 -0
  65. package/dist/esm/permissionless/api/oracles/schemas.js +59 -0
  66. package/dist/esm/permissionless/api/oracles/types.js +1 -0
  67. package/dist/esm/permissionless/api/schemas.js +25 -0
  68. package/dist/esm/permissionless/api/transactions/InstanceOwnerTransactions.js +229 -0
  69. package/dist/esm/permissionless/api/transactions/index.js +3 -0
  70. package/dist/esm/permissionless/api/transactions/lp-price-feeds.js +84 -0
  71. package/dist/esm/permissionless/api/transactions/types.js +1 -0
  72. package/dist/esm/permissionless/api/types.js +1 -0
  73. package/dist/esm/permissionless/bindings/cross-chain-multisig.js +1 -1
  74. package/dist/esm/permissionless/bindings/index.js +3 -3
  75. package/dist/esm/permissionless/bindings/instance-manager.js +3 -3
  76. package/dist/esm/permissionless/index.js +17 -9
  77. package/dist/esm/permissionless/utils/governance/timelock-txs.js +1 -1
  78. package/dist/esm/permissionless/utils/index.js +4 -4
  79. package/dist/esm/permissionless/utils/price-update/get-price-update-tx.js +1 -1
  80. package/dist/esm/permissionless/utils/price-update/index.js +1 -1
  81. package/dist/types/offchain/AbstractOffchainNamespace.d.ts +12 -0
  82. package/dist/types/permissionless/api/GearboxPermissionless.d.ts +71 -0
  83. package/dist/types/permissionless/api/chains/ChainsNamespace.d.ts +99 -0
  84. package/dist/types/permissionless/api/chains/index.d.ts +3 -0
  85. package/dist/types/permissionless/api/chains/schemas.d.ts +49 -0
  86. package/dist/types/permissionless/api/chains/types.d.ts +58 -0
  87. package/dist/types/permissionless/api/deploy/PermissionlessDeploy.d.ts +69 -0
  88. package/dist/types/permissionless/api/deploy/effective-staleness.d.ts +19 -0
  89. package/dist/types/permissionless/api/deploy/index.d.ts +4 -0
  90. package/dist/types/permissionless/api/deploy/types.d.ts +87 -0
  91. package/dist/types/permissionless/api/errors.d.ts +63 -0
  92. package/dist/types/permissionless/api/index.d.ts +17 -0
  93. package/dist/types/permissionless/api/oracles/PermissionlessOracles.d.ts +64 -0
  94. package/dist/types/permissionless/api/oracles/index.d.ts +3 -0
  95. package/dist/types/permissionless/api/oracles/schemas.d.ts +103 -0
  96. package/dist/types/permissionless/api/oracles/types.d.ts +63 -0
  97. package/dist/types/permissionless/api/schemas.d.ts +22 -0
  98. package/dist/types/permissionless/api/transactions/InstanceOwnerTransactions.d.ts +60 -0
  99. package/dist/types/permissionless/api/transactions/index.d.ts +3 -0
  100. package/dist/types/permissionless/api/transactions/lp-price-feeds.d.ts +17 -0
  101. package/dist/types/permissionless/api/transactions/types.d.ts +36 -0
  102. package/dist/types/permissionless/api/types.d.ts +12 -0
  103. package/dist/types/permissionless/bindings/factory/credit-factory.d.ts +1 -1
  104. package/dist/types/permissionless/bindings/factory/loss-policy-factory.d.ts +1 -1
  105. package/dist/types/permissionless/bindings/factory/pool-factory.d.ts +1 -1
  106. package/dist/types/permissionless/bindings/factory/price-oracle-factory.d.ts +1 -1
  107. package/dist/types/permissionless/bindings/index.d.ts +1 -1
  108. package/dist/types/permissionless/core/index.d.ts +1 -1
  109. package/dist/types/permissionless/index.d.ts +23 -10
  110. package/dist/types/permissionless/utils/governance/index.d.ts +1 -1
  111. package/dist/types/permissionless/utils/index.d.ts +1 -1
  112. package/package.json +1 -1
@@ -0,0 +1,63 @@
1
+ import { PriceFeed } from "../../core/pricefeed.js";
2
+ import "../../core/index.js";
3
+ import { Address } from "viem";
4
+ //#region src/permissionless/api/oracles/types.d.ts
5
+ /**
6
+ * Where a feed stands for the asset it prices:
7
+ *
8
+ * - `private` — known to the backend only, not yet in the PriceFeedStore;
9
+ * - `inStore` — allowed for the asset on chain;
10
+ * - `pendingForbidden` — still allowed, with a removal prepared;
11
+ * - `forbidden` — no longer allowed for the asset.
12
+ **/
13
+ type PermissionlessPriceFeedStatus = "private" | "inStore" | "pendingForbidden" | "forbidden";
14
+ /**
15
+ * One asset of a chain, with the feeds attached to it. The key is spelled
16
+ * `pricefeed` because that is what the backend answers with.
17
+ **/
18
+ interface PermissionlessAsset {
19
+ address: Address;
20
+ symbol: string;
21
+ name: string;
22
+ decimals: number;
23
+ isInStore: boolean;
24
+ owner: Address;
25
+ priceFeeds: Array<{
26
+ pricefeed: PriceFeed;
27
+ status: PermissionlessPriceFeedStatus;
28
+ }>;
29
+ }
30
+ /**
31
+ * The PriceFeedStore of one chain as the backend has indexed it: the assets
32
+ * it prices, the feeds it carries, and which feed is allowed on which asset.
33
+ **/
34
+ interface PermissionlessPriceFeedStore {
35
+ chainId: number;
36
+ name: string;
37
+ isPublic: boolean;
38
+ isActivated: boolean;
39
+ explorerUrl: string;
40
+ assets: PermissionlessAsset[];
41
+ priceFeeds: PriceFeed[];
42
+ }
43
+ /**
44
+ * A price per feed, and a market cap per feed and the asset it prices.
45
+ * `null` is a price the backend could not read, not a zero.
46
+ **/
47
+ interface PermissionlessPrices {
48
+ prices: Record<Address, string | null>;
49
+ marketCaps: Record<Address, Record<Address, string | null>>;
50
+ time: number;
51
+ }
52
+ /** Args of {@link PermissionlessOracles.getPrices}. */
53
+ interface GetPricesArgs {
54
+ chainId: number;
55
+ /**
56
+ * The feeds to price. Any address answering `latestRoundData` works — the
57
+ * store does not have to carry it, which is the point of reading the chain
58
+ * rather than asking the backend.
59
+ **/
60
+ priceFeeds: Address[];
61
+ }
62
+ //#endregion
63
+ export { GetPricesArgs, PermissionlessAsset, PermissionlessPriceFeedStatus, PermissionlessPriceFeedStore, PermissionlessPrices };
@@ -0,0 +1,22 @@
1
+ import { Address } from "viem";
2
+ import { z } from "zod/v4";
3
+ //#region src/permissionless/api/schemas.d.ts
4
+ /**
5
+ * Runtime schemas shared by the {@link GearboxPermissionless} namespaces.
6
+ *
7
+ * Addresses are validated but never rewritten: the backend serves them in the
8
+ * case its database holds, and its payloads key records by address, so
9
+ * checksumming here would silently break a lookup by the key it answered with.
10
+ * A caller that needs one form converts with viem's `getAddress`.
11
+ **/
12
+ /** An address, in whatever case the backend serves it. */
13
+ declare const addressSchema: z.ZodCustom<`0x${string}`, `0x${string}`>;
14
+ /** A `0x`-prefixed hex string, as viem's `Hex`. */
15
+ declare const hexSchema: z.ZodCustom<`0x${string}`, `0x${string}`>;
16
+ /**
17
+ * A record keyed by address. Spelled out here because zod types a record key
18
+ * by the schema's output, which the branded `Address` is not inferred as.
19
+ **/
20
+ declare function addressRecord<V extends z.ZodType>(value: V): z.ZodType<Record<Address, z.output<V>>>;
21
+ //#endregion
22
+ export { addressRecord, addressSchema, hexSchema };
@@ -0,0 +1,60 @@
1
+ import { ChainsNamespace } from "../chains/ChainsNamespace.js";
2
+ import { PermissionlessOracles } from "../oracles/PermissionlessOracles.js";
3
+ import { InstanceTxs } from "../../utils/governance/types.js";
4
+ import { ChangeNamesArgs, ChangeStalenessPeriodsArgs, ForbidFeedsArgs, InstanceTxsArgs } from "./types.js";
5
+ //#region src/permissionless/api/transactions/InstanceOwnerTransactions.d.ts
6
+ /**
7
+ * The Safe batches an instance owner executes to apply what a curator
8
+ * prepared: adding their private feeds to the PriceFeedStore, renaming feeds,
9
+ * changing staleness periods, forbidding feeds and refreshing LP bounds.
10
+ *
11
+ * Every batch is wrapped with `wrapConfigureLocal`, so the InstanceManager is
12
+ * the only caller the PriceFeedStore ever sees.
13
+ *
14
+ * Backend-free: a batch is built off the chain it will be executed on, and
15
+ * the store it reads is the one {@link PermissionlessOracles} already
16
+ * fetched. Nothing is sent either — a curator never executes these
17
+ * themselves. They prepare a batch and hand it to the instance owner, who
18
+ * reviews and executes it from their Safe.
19
+ *
20
+ * ```ts
21
+ * const txs = await permissionless.transactions.addFeeds({
22
+ * chainId: 1,
23
+ * owner: curator,
24
+ * });
25
+ * ```
26
+ **/
27
+ declare class InstanceOwnerTransactions {
28
+ #private;
29
+ constructor(chains: ChainsNamespace, oracles: PermissionlessOracles);
30
+ /**
31
+ * The batch that adds the owner's private feeds to the store and allows
32
+ * them on the assets they were connected to. Only feeds that actually carry
33
+ * a connection are added: a feed nobody priced would land in the store
34
+ * doing nothing.
35
+ **/
36
+ addFeeds({ chainId, owner }: InstanceTxsArgs): Promise<InstanceTxs>;
37
+ /**
38
+ * The batch that renames feeds already in the store. A name is part of what
39
+ * the store holds, so changing one is a remove and a fresh add, followed by
40
+ * allowing the feed again on every asset that priced it.
41
+ **/
42
+ changeNames({ chainId, owner, names }: ChangeNamesArgs): Promise<InstanceTxs>;
43
+ /**
44
+ * The batch that changes how long each feed's price stays valid.
45
+ **/
46
+ changeStalenessPeriods({ chainId, owner, periods }: ChangeStalenessPeriodsArgs): Promise<InstanceTxs>;
47
+ /**
48
+ * The batch that forbids feeds on the assets they were allowed for.
49
+ **/
50
+ forbidFeeds({ chainId, owner, tokens }: ForbidFeedsArgs): Promise<InstanceTxs>;
51
+ /**
52
+ * The batch that pulls every drifted LP feed's lower bound back under its
53
+ * exchange rate. Unlike the others this takes no input: the whole store is
54
+ * scanned and only the feeds that drifted produce a transaction, so this
55
+ * one is slow.
56
+ **/
57
+ updateBounds({ chainId, owner }: InstanceTxsArgs): Promise<InstanceTxs>;
58
+ }
59
+ //#endregion
60
+ export { InstanceOwnerTransactions };
@@ -0,0 +1,3 @@
1
+ import { ChangeNamesArgs, ChangeStalenessPeriodsArgs, ForbidFeedsArgs, InstanceTxsArgs } from "./types.js";
2
+ import { InstanceOwnerTransactions } from "./InstanceOwnerTransactions.js";
3
+ export { ChangeNamesArgs, ChangeStalenessPeriodsArgs, ForbidFeedsArgs, InstanceOwnerTransactions, InstanceTxsArgs };
@@ -0,0 +1,17 @@
1
+ import { RawTx } from "../../../onchain/types/transactions.js";
2
+ import "../../../onchain/index.js";
3
+ import { Address, PublicClient } from "viem";
4
+ //#region src/permissionless/api/transactions/lp-price-feeds.d.ts
5
+ /**
6
+ * Moves an LP feed's lower bound back under its current exchange rate, when
7
+ * the rate has outgrown the bound or drifted far enough from it to be worth a
8
+ * transaction. Returns nothing when the bound still fits.
9
+ **/
10
+ declare function updateBounds(client: PublicClient, address: Address): Promise<RawTx[]>;
11
+ /**
12
+ * Of the whole feed tree behind `feeds`, the ones that are LP feeds: the
13
+ * probe keeps whatever answers `getLPExchangeRate`.
14
+ **/
15
+ declare function getFeedsToUpdate(client: PublicClient, pfCompressor: Address, feeds: Address[]): Promise<Address[]>;
16
+ //#endregion
17
+ export { getFeedsToUpdate, updateBounds };
@@ -0,0 +1,36 @@
1
+ import { Address } from "viem";
2
+ //#region src/permissionless/api/transactions/types.d.ts
3
+ /**
4
+ * What every batch of {@link InstanceOwnerTransactions} names.
5
+ *
6
+ * The chain must be one {@link ChainsNamespace} serves a client for: a batch
7
+ * is built off the chain it will be executed on.
8
+ **/
9
+ interface InstanceTxsArgs {
10
+ chainId: number;
11
+ /**
12
+ * Whose rows the batch is built from, and who it records as its author.
13
+ *
14
+ * Required: unlike the backend routes this replaced, nothing here carries
15
+ * an identity of its own, so the caller names the curator whose feeds and
16
+ * connections the batch applies.
17
+ **/
18
+ owner: Address;
19
+ }
20
+ /** Args of {@link InstanceOwnerTransactions.changeNames}. */
21
+ interface ChangeNamesArgs extends InstanceTxsArgs {
22
+ /** The new name of each feed, keyed by the feed's address. */
23
+ names: Record<Address, string>;
24
+ }
25
+ /** Args of {@link InstanceOwnerTransactions.changeStalenessPeriods}. */
26
+ interface ChangeStalenessPeriodsArgs extends InstanceTxsArgs {
27
+ /** The new staleness period in seconds, keyed by the feed's address. */
28
+ periods: Record<Address, number>;
29
+ }
30
+ /** Args of {@link InstanceOwnerTransactions.forbidFeeds}. */
31
+ interface ForbidFeedsArgs extends InstanceTxsArgs {
32
+ /** The feeds to forbid, keyed by the asset they were allowed for. */
33
+ tokens: Record<Address, Address[]>;
34
+ }
35
+ //#endregion
36
+ export { ChangeNamesArgs, ChangeStalenessPeriodsArgs, ForbidFeedsArgs, InstanceTxsArgs };
@@ -0,0 +1,12 @@
1
+ import { GearboxAPIOptions } from "../../offchain/types.js";
2
+ //#region src/permissionless/api/types.d.ts
3
+ /**
4
+ * Options for creating a {@link GearboxPermissionless} instance.
5
+ *
6
+ * The same options {@link GearboxAPI} takes, since both clients read the same
7
+ * backend, minus the chains: those the permissionless backend decides, and
8
+ * {@link ChainsNamespace} reads that list and builds the clients from it.
9
+ **/
10
+ type GearboxPermissionlessOptions = Omit<GearboxAPIOptions, "chainIds">;
11
+ //#endregion
12
+ export { GearboxPermissionlessOptions };
@@ -1,5 +1,5 @@
1
- import { AbstractFactory } from "./abstract-factory.js";
2
1
  import { DeployParams, SetExpirationDateParams, SetFeesParams } from "../types.js";
2
+ import { AbstractFactory } from "./abstract-factory.js";
3
3
  import { Address, Hex } from "viem";
4
4
  //#region src/permissionless/bindings/factory/credit-factory.d.ts
5
5
  declare const abi: readonly [{
@@ -1,5 +1,5 @@
1
- import { AbstractFactory } from "./abstract-factory.js";
2
1
  import { AccessMode } from "../types.js";
2
+ import { AbstractFactory } from "./abstract-factory.js";
3
3
  import { Hex } from "viem";
4
4
  //#region src/permissionless/bindings/factory/loss-policy-factory.d.ts
5
5
  declare const abi: readonly [{
@@ -1,5 +1,5 @@
1
- import { AbstractFactory } from "./abstract-factory.js";
2
1
  import { SetTokenQuotaIncreaseFeeParams } from "../types.js";
2
+ import { AbstractFactory } from "./abstract-factory.js";
3
3
  import { Address, Hex } from "viem";
4
4
  //#region src/permissionless/bindings/factory/pool-factory.d.ts
5
5
  declare const abi: readonly [{
@@ -1,5 +1,5 @@
1
- import { AbstractFactory } from "./abstract-factory.js";
2
1
  import { SetPriceFeedParams, SetReservePriceFeedParams } from "../types.js";
2
+ import { AbstractFactory } from "./abstract-factory.js";
3
3
  import { Hex } from "viem";
4
4
  //#region src/permissionless/bindings/factory/price-oracle-factory.d.ts
5
5
  declare const abi: readonly [{
@@ -4,12 +4,12 @@ import { TokenCompressorContract } from "./compressors/token-compressor.js";
4
4
  import { WithdrawalCompressorContract } from "./compressors/withdrawal-compressor.js";
5
5
  import "./compressors/index.js";
6
6
  import { ConstructorParams, CrossChainMultisigContract, Proposal } from "./cross-chain-multisig.js";
7
- import { AccessMode, AddAssetParams, AllowTokenParams, CreditManagerFees, DeployParams, ForbidAdapterParams, ForbidTokenParams, Market, PauseCreditManagerParams, PeripheryDomain, SetExpirationDateParams, SetFeesParams, SetPriceFeedParams, SetReservePriceFeedParams, SetTokenQuotaIncreaseFeeParams, UnpauseCreditManagerParams } from "./types.js";
8
7
  import { QueuedAndExecutedTransaction, SafeBatch, SafeMeta, SafeTx, TimelockTransaction, TimelockTxParams } from "./governance/types.js";
9
8
  import { GovernorContract } from "./governance/governor.js";
10
9
  import { TimeLockContract } from "./governance/timelock.js";
11
10
  import "./governance/index.js";
12
11
  import { InstanceManagerContract } from "./instance-manager.js";
12
+ import { AccessMode, AddAssetParams, AllowTokenParams, CreditManagerFees, DeployParams, ForbidAdapterParams, ForbidTokenParams, Market, PauseCreditManagerParams, PeripheryDomain, SetExpirationDateParams, SetFeesParams, SetPriceFeedParams, SetReservePriceFeedParams, SetTokenQuotaIncreaseFeeParams, UnpauseCreditManagerParams } from "./types.js";
13
13
  import { MarketConfiguratorContract } from "./market-configurator.js";
14
14
  import { MarketConfiguratorFactoryContract } from "./market-configurator-factory.js";
15
15
  import { PriceFeedStoreContract } from "./price-feed-store.js";
@@ -1,7 +1,7 @@
1
1
  import { Auditor } from "./auditor.js";
2
2
  import { AuditEvent, Bytecode, Deployment, DeploymentExtended } from "./bytecode.js";
3
- import { Batch, CrossChainCall, RecoveryMessage, Signature } from "./proposal.js";
4
3
  import { PriceFeed } from "./pricefeed.js";
5
4
  import { InputValueParams, PriceFeedConstructorParam, PriceFeedParamType, PriceFeedParams, PriceFeedSetupParams } from "./pricefeed-builder.js";
5
+ import { Batch, CrossChainCall, RecoveryMessage, Signature } from "./proposal.js";
6
6
  import { createCallData } from "./raw-tx.js";
7
7
  export { AuditEvent, Auditor, Batch, Bytecode, CrossChainCall, Deployment, DeploymentExtended, InputValueParams, PriceFeed, PriceFeedConstructorParam, PriceFeedParamType, PriceFeedParams, PriceFeedSetupParams, RecoveryMessage, Signature, createCallData };
@@ -1,42 +1,55 @@
1
- import { AddressProviderContract } from "./bindings/address-provider.js";
1
+ import { GearboxPermissionlessOptions } from "./api/types.js";
2
+ import { AttachChainsArgs, ChainScope, ChainSummaryArgs, PermissionlessChain, PermissionlessChainSummary } from "./api/chains/types.js";
3
+ import { ChainsNamespace } from "./api/chains/ChainsNamespace.js";
2
4
  import { Auditor } from "./core/auditor.js";
3
5
  import { AuditEvent, Bytecode, Deployment, DeploymentExtended } from "./core/bytecode.js";
6
+ import { PriceFeed } from "./core/pricefeed.js";
7
+ import { InputValueParams, PriceFeedConstructorParam, PriceFeedParamType, PriceFeedParams, PriceFeedSetupParams } from "./core/pricefeed-builder.js";
8
+ import { Batch, CrossChainCall, RecoveryMessage, Signature } from "./core/proposal.js";
9
+ import { createCallData } from "./core/raw-tx.js";
10
+ import "./core/index.js";
11
+ import { FunctionParams, ValueParams, encodeFunctionParams } from "./utils/abi-encoder.js";
12
+ import { DeployArgs, DeployContractArgs, DeployPriceFeedArgs, PreparedDeployment, PreparedPriceFeedDeployment } from "./api/deploy/types.js";
13
+ import { DEFAULT_DEPLOY_SALT, PermissionlessDeploy, priceFeedSalt } from "./api/deploy/PermissionlessDeploy.js";
14
+ import { GetPricesArgs, PermissionlessAsset, PermissionlessPriceFeedStatus, PermissionlessPriceFeedStore, PermissionlessPrices } from "./api/oracles/types.js";
15
+ import { GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, PermissionlessOracles } from "./api/oracles/PermissionlessOracles.js";
16
+ import { AddressProviderContract } from "./bindings/address-provider.js";
4
17
  import { BytecodeRepositoryContract } from "./bindings/bytecode-repository.js";
5
18
  import { TokenCompressorContract } from "./bindings/compressors/token-compressor.js";
6
19
  import { WithdrawalCompressorContract } from "./bindings/compressors/withdrawal-compressor.js";
7
- import { Batch, CrossChainCall, RecoveryMessage, Signature } from "./core/proposal.js";
8
20
  import { ConstructorParams, CrossChainMultisigContract, Proposal } from "./bindings/cross-chain-multisig.js";
9
- import { AccessMode, AddAssetParams, AllowTokenParams, CreditManagerFees, DeployParams, ForbidAdapterParams, ForbidTokenParams, Market, PauseCreditManagerParams, PeripheryDomain, SetExpirationDateParams, SetFeesParams, SetPriceFeedParams, SetReservePriceFeedParams, SetTokenQuotaIncreaseFeeParams, UnpauseCreditManagerParams } from "./bindings/types.js";
10
21
  import { QueuedAndExecutedTransaction, SafeBatch, SafeMeta, SafeTx, TimelockTransaction, TimelockTxParams } from "./bindings/governance/types.js";
11
22
  import { GovernorContract } from "./bindings/governance/governor.js";
12
23
  import { TimeLockContract } from "./bindings/governance/timelock.js";
13
24
  import { InstanceManagerContract } from "./bindings/instance-manager.js";
25
+ import { AccessMode, AddAssetParams, AllowTokenParams, CreditManagerFees, DeployParams, ForbidAdapterParams, ForbidTokenParams, Market, PauseCreditManagerParams, PeripheryDomain, SetExpirationDateParams, SetFeesParams, SetPriceFeedParams, SetReservePriceFeedParams, SetTokenQuotaIncreaseFeeParams, UnpauseCreditManagerParams } from "./bindings/types.js";
14
26
  import { MarketConfiguratorContract } from "./bindings/market-configurator.js";
15
27
  import { MarketConfiguratorFactoryContract } from "./bindings/market-configurator-factory.js";
16
- import { PriceFeed } from "./core/pricefeed.js";
17
- import { InputValueParams, PriceFeedConstructorParam, PriceFeedParamType, PriceFeedParams, PriceFeedSetupParams } from "./core/pricefeed-builder.js";
18
- import { createCallData } from "./core/raw-tx.js";
19
- import "./core/index.js";
20
28
  import { PriceFeedStoreContract } from "./bindings/price-feed-store.js";
21
29
  import { priceFeedSetupParams } from "./bindings/pricefeeds/index.js";
22
30
  import { RoutingManagerContract } from "./bindings/router/routing-manager.js";
23
31
  import { TreasurySplitterContract } from "./bindings/treasury-splitter.js";
24
32
  import "./bindings/index.js";
33
+ import { InstanceTxs, TimelockTxs } from "./utils/governance/types.js";
34
+ import { ChangeNamesArgs, ChangeStalenessPeriodsArgs, ForbidFeedsArgs, InstanceTxsArgs } from "./api/transactions/types.js";
35
+ import { InstanceOwnerTransactions } from "./api/transactions/InstanceOwnerTransactions.js";
36
+ import { GearboxPermissionless } from "./api/GearboxPermissionless.js";
37
+ import { deriveEffectiveStalenessPeriod } from "./api/deploy/effective-staleness.js";
38
+ import { PermissionlessChainUnreachableError, PermissionlessNotAttachedError, PriceFeedNotInStoreError, PriceFeedSaltMissingError, PriceFeedStalenessUnknownError } from "./api/errors.js";
39
+ import "./api/index.js";
25
40
  import { ArchiveTransport, ArchiveTransportConfig } from "./chains/archive-transport.js";
26
41
  import { chunkedLogsTransport } from "./chains/chunked-log-transport.js";
27
42
  import { Addresses } from "./deployment/addresses.js";
28
43
  import { CCMConstructorParams, MAINNET_CCM_CONSTRUCTOR_PARAMS, MAINNET_DEPLOYMENT_BLOCK, MAINNET_DEPLOYMENT_CCM_SALT, MAINNET_DEPLOYMENT_IM_SALT } from "./deployment/mainnet.js";
29
- import { FunctionParams, ValueParams, encodeFunctionParams } from "./utils/abi-encoder.js";
30
44
  import { getBlockNumberByTimestamp } from "./utils/block-utils.js";
31
45
  import { PUBLIC_CREATE2_FACTORY, checkCreate2Deployment, checkCreate2DeploymentAddress, createCreate2DeployRawTx, deployUsingPublicCreate2, getCreate2AddressPublicFactory, getCreate2DeploymentAddress, handleSalt } from "./utils/create2.js";
32
46
  import { convertPercent, deepJsonParse, formatBytecodeSize, formatBytecodeVersion, shortenHash, significantTrunc } from "./utils/format.js";
33
47
  import { calculateChecksum, convertRawTxToSafeMultisigTx, getSafeBatch, getSafeBatches } from "./utils/governance/batch.js";
34
48
  import { convertQueueBatchToExecuteTx } from "./utils/governance/timelock-txs.js";
35
- import { InstanceTxs, TimelockTxs } from "./utils/governance/types.js";
36
49
  import { BYTECODE_REPOSITORY, CROSS_CHAIN_GOVERNANCE, CROSS_CHAIN_MULTISIG, INSTANCE_MANAGER, MARKET_CONFIGURATOR_FACTORY, PRICE_FEED_STORE, TOKEN_COMPRESSOR } from "./utils/literals.js";
37
50
  import { getPriceUpdateTx } from "./utils/price-update/get-price-update-tx.js";
38
51
  import { getPrices } from "./utils/price-update/get-prices.js";
39
52
  import { GetUpdatablePriceFeedsArgs, getUpdatablePriceFeeds } from "./utils/price-update/get-updatable-feeds.js";
40
53
  import { normalizeSignature } from "./utils/signature.js";
41
54
  import "./utils/index.js";
42
- export { AccessMode, AddAssetParams, AddressProviderContract, Addresses, AllowTokenParams, ArchiveTransport, ArchiveTransportConfig, AuditEvent, Auditor, BYTECODE_REPOSITORY, Batch, Bytecode, BytecodeRepositoryContract, CCMConstructorParams, CROSS_CHAIN_GOVERNANCE, CROSS_CHAIN_MULTISIG, ConstructorParams, CreditManagerFees, CrossChainCall, CrossChainMultisigContract, DeployParams, Deployment, DeploymentExtended, ForbidAdapterParams, ForbidTokenParams, FunctionParams, GetUpdatablePriceFeedsArgs, GovernorContract, INSTANCE_MANAGER, InputValueParams, InstanceManagerContract, InstanceTxs, MAINNET_CCM_CONSTRUCTOR_PARAMS, MAINNET_DEPLOYMENT_BLOCK, MAINNET_DEPLOYMENT_CCM_SALT, MAINNET_DEPLOYMENT_IM_SALT, MARKET_CONFIGURATOR_FACTORY, Market, MarketConfiguratorContract, MarketConfiguratorFactoryContract, PRICE_FEED_STORE, PUBLIC_CREATE2_FACTORY, PauseCreditManagerParams, PeripheryDomain, PriceFeed, PriceFeedConstructorParam, PriceFeedParamType, PriceFeedParams, PriceFeedSetupParams, PriceFeedStoreContract, Proposal, QueuedAndExecutedTransaction, RecoveryMessage, RoutingManagerContract, SafeBatch, SafeMeta, SafeTx, SetExpirationDateParams, SetFeesParams, SetPriceFeedParams, SetReservePriceFeedParams, SetTokenQuotaIncreaseFeeParams, Signature, TOKEN_COMPRESSOR, TimeLockContract, TimelockTransaction, TimelockTxParams, TimelockTxs, TokenCompressorContract, TreasurySplitterContract, UnpauseCreditManagerParams, ValueParams, WithdrawalCompressorContract, calculateChecksum, checkCreate2Deployment, checkCreate2DeploymentAddress, chunkedLogsTransport, convertPercent, convertQueueBatchToExecuteTx, convertRawTxToSafeMultisigTx, createCallData, createCreate2DeployRawTx, deepJsonParse, deployUsingPublicCreate2, encodeFunctionParams, formatBytecodeSize, formatBytecodeVersion, getBlockNumberByTimestamp, getCreate2AddressPublicFactory, getCreate2DeploymentAddress, getPriceUpdateTx, getPrices, getSafeBatch, getSafeBatches, getUpdatablePriceFeeds, handleSalt, normalizeSignature, priceFeedSetupParams, shortenHash, significantTrunc };
55
+ export { AccessMode, AddAssetParams, AddressProviderContract, Addresses, AllowTokenParams, ArchiveTransport, ArchiveTransportConfig, AttachChainsArgs, AuditEvent, Auditor, BYTECODE_REPOSITORY, Batch, Bytecode, BytecodeRepositoryContract, CCMConstructorParams, CROSS_CHAIN_GOVERNANCE, CROSS_CHAIN_MULTISIG, ChainScope, ChainSummaryArgs, ChainsNamespace, ChangeNamesArgs, ChangeStalenessPeriodsArgs, ConstructorParams, CreditManagerFees, CrossChainCall, CrossChainMultisigContract, DEFAULT_DEPLOY_SALT, DeployArgs, DeployContractArgs, DeployParams, DeployPriceFeedArgs, Deployment, DeploymentExtended, ForbidAdapterParams, ForbidFeedsArgs, ForbidTokenParams, FunctionParams, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GearboxPermissionless, GearboxPermissionlessOptions, GetPricesArgs, GetUpdatablePriceFeedsArgs, GovernorContract, INSTANCE_MANAGER, InputValueParams, InstanceManagerContract, InstanceOwnerTransactions, InstanceTxs, InstanceTxsArgs, MAINNET_CCM_CONSTRUCTOR_PARAMS, MAINNET_DEPLOYMENT_BLOCK, MAINNET_DEPLOYMENT_CCM_SALT, MAINNET_DEPLOYMENT_IM_SALT, MARKET_CONFIGURATOR_FACTORY, Market, MarketConfiguratorContract, MarketConfiguratorFactoryContract, PRICE_FEED_STORE, PUBLIC_CREATE2_FACTORY, PauseCreditManagerParams, PeripheryDomain, PermissionlessAsset, PermissionlessChain, PermissionlessChainSummary, PermissionlessChainUnreachableError, PermissionlessDeploy, PermissionlessNotAttachedError, PermissionlessOracles, PermissionlessPriceFeedStatus, PermissionlessPriceFeedStore, PermissionlessPrices, PreparedDeployment, PreparedPriceFeedDeployment, PriceFeed, PriceFeedConstructorParam, PriceFeedNotInStoreError, PriceFeedParamType, PriceFeedParams, PriceFeedSaltMissingError, PriceFeedSetupParams, PriceFeedStalenessUnknownError, PriceFeedStoreContract, Proposal, QueuedAndExecutedTransaction, RecoveryMessage, RoutingManagerContract, SafeBatch, SafeMeta, SafeTx, SetExpirationDateParams, SetFeesParams, SetPriceFeedParams, SetReservePriceFeedParams, SetTokenQuotaIncreaseFeeParams, Signature, TOKEN_COMPRESSOR, TimeLockContract, TimelockTransaction, TimelockTxParams, TimelockTxs, TokenCompressorContract, TreasurySplitterContract, UnpauseCreditManagerParams, ValueParams, WithdrawalCompressorContract, calculateChecksum, checkCreate2Deployment, checkCreate2DeploymentAddress, chunkedLogsTransport, convertPercent, convertQueueBatchToExecuteTx, convertRawTxToSafeMultisigTx, createCallData, createCreate2DeployRawTx, deepJsonParse, deployUsingPublicCreate2, deriveEffectiveStalenessPeriod, encodeFunctionParams, formatBytecodeSize, formatBytecodeVersion, getBlockNumberByTimestamp, getCreate2AddressPublicFactory, getCreate2DeploymentAddress, getPriceUpdateTx, getPrices, getSafeBatch, getSafeBatches, getUpdatablePriceFeeds, handleSalt, normalizeSignature, priceFeedSalt, priceFeedSetupParams, shortenHash, significantTrunc };
@@ -1,4 +1,4 @@
1
+ import { InstanceTxs, TimelockTxs } from "./types.js";
1
2
  import { calculateChecksum, convertRawTxToSafeMultisigTx, getSafeBatch, getSafeBatches } from "./batch.js";
2
3
  import { convertQueueBatchToExecuteTx } from "./timelock-txs.js";
3
- import { InstanceTxs, TimelockTxs } from "./types.js";
4
4
  export { InstanceTxs, TimelockTxs, calculateChecksum, convertQueueBatchToExecuteTx, convertRawTxToSafeMultisigTx, getSafeBatch, getSafeBatches };
@@ -1,10 +1,10 @@
1
1
  import { FunctionParams, ValueParams, encodeFunctionParams } from "./abi-encoder.js";
2
+ import { InstanceTxs, TimelockTxs } from "./governance/types.js";
2
3
  import { getBlockNumberByTimestamp } from "./block-utils.js";
3
4
  import { PUBLIC_CREATE2_FACTORY, checkCreate2Deployment, checkCreate2DeploymentAddress, createCreate2DeployRawTx, deployUsingPublicCreate2, getCreate2AddressPublicFactory, getCreate2DeploymentAddress, handleSalt } from "./create2.js";
4
5
  import { convertPercent, deepJsonParse, formatBytecodeSize, formatBytecodeVersion, shortenHash, significantTrunc } from "./format.js";
5
6
  import { calculateChecksum, convertRawTxToSafeMultisigTx, getSafeBatch, getSafeBatches } from "./governance/batch.js";
6
7
  import { convertQueueBatchToExecuteTx } from "./governance/timelock-txs.js";
7
- import { InstanceTxs, TimelockTxs } from "./governance/types.js";
8
8
  import "./governance/index.js";
9
9
  import { BYTECODE_REPOSITORY, CROSS_CHAIN_GOVERNANCE, CROSS_CHAIN_MULTISIG, INSTANCE_MANAGER, MARKET_CONFIGURATOR_FACTORY, PRICE_FEED_STORE, TOKEN_COMPRESSOR } from "./literals.js";
10
10
  import { getPriceUpdateTx } from "./price-update/get-price-update-tx.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "17.10.1",
3
+ "version": "17.11.0",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "repository": {