@gearbox-protocol/sdk 14.10.3-next.1 → 14.10.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.
- package/dist/cjs/dev/AccountOpener.js +5 -4
- package/dist/cjs/plugins/apy/strategy-data-source.js +1 -1
- package/dist/cjs/sdk/market/MarketSuite.js +63 -3
- package/dist/cjs/sdk/market/credit/CreditSuite.js +81 -9
- package/dist/cjs/sdk/market/index.js +1 -3
- package/dist/cjs/sdk/market/pool/PoolSuite.js +64 -0
- package/dist/cjs/sdk/market/pool/PoolV310Contract.js +0 -20
- package/dist/cjs/sdk/pools/PoolService.js +57 -67
- package/dist/esm/dev/AccountOpener.js +5 -4
- package/dist/esm/plugins/apy/strategy-data-source.js +1 -1
- package/dist/esm/sdk/market/MarketSuite.js +63 -3
- package/dist/esm/sdk/market/credit/CreditSuite.js +81 -9
- package/dist/esm/sdk/market/index.js +0 -1
- package/dist/esm/sdk/market/pool/PoolSuite.js +64 -0
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +0 -20
- package/dist/esm/sdk/pools/PoolService.js +57 -72
- package/dist/types/sdk/market/MarketSuite.d.ts +70 -1
- package/dist/types/sdk/market/credit/CreditSuite.d.ts +84 -4
- package/dist/types/sdk/market/index.d.ts +0 -1
- package/dist/types/sdk/market/pool/PoolSuite.d.ts +75 -0
- package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -12
- package/dist/types/sdk/pools/PoolService.d.ts +3 -3
- package/dist/types/sdk/pools/types.d.ts +2 -7
- package/package.json +1 -1
- package/dist/cjs/sdk/market/zapper/IERC20ZapperDepositsContract.js +0 -54
- package/dist/cjs/sdk/market/zapper/IETHZapperDepositsContract.js +0 -45
- package/dist/cjs/sdk/market/zapper/IZapperContract.js +0 -54
- package/dist/cjs/sdk/market/zapper/index.js +0 -26
- package/dist/esm/sdk/market/zapper/IERC20ZapperDepositsContract.js +0 -30
- package/dist/esm/sdk/market/zapper/IETHZapperDepositsContract.js +0 -21
- package/dist/esm/sdk/market/zapper/IZapperContract.js +0 -30
- package/dist/esm/sdk/market/zapper/index.js +0 -3
- package/dist/types/sdk/market/zapper/IERC20ZapperDepositsContract.d.ts +0 -211
- package/dist/types/sdk/market/zapper/IETHZapperDepositsContract.d.ts +0 -47
- package/dist/types/sdk/market/zapper/IZapperContract.d.ts +0 -139
- package/dist/types/sdk/market/zapper/index.d.ts +0 -3
|
@@ -1,23 +1,103 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
|
-
import type { CreditSuiteState
|
|
2
|
+
import type { CreditSuiteState } from "../../base/index.js";
|
|
3
3
|
import { SDKConstruct } from "../../base/index.js";
|
|
4
4
|
import type { OnchainSDK } from "../../OnchainSDK.js";
|
|
5
5
|
import type { IRouterContract } from "../../router/index.js";
|
|
6
6
|
import type { CreditSuiteStateHuman } from "../../types/index.js";
|
|
7
|
+
import type { MarketConfiguratorContract } from "../MarketConfiguratorContract.js";
|
|
8
|
+
import type { MarketSuite } from "../MarketSuite.js";
|
|
7
9
|
import type { CreditFacadeContract, ICreditConfiguratorContract, ICreditManagerContract } from "./types.js";
|
|
10
|
+
/**
|
|
11
|
+
* SDK aggregate for one credit-manager branch inside a market.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* This is the market's "retail branch": it borrows
|
|
15
|
+
* liquidity from the pool to open credit accounts under an isolated mandate.
|
|
16
|
+
* The suite groups the three contracts that define that branch:
|
|
17
|
+
* `creditManager` for debt, collateral, adapters, and account accounting;
|
|
18
|
+
* `creditFacade` for user-facing account operations and multicalls; and
|
|
19
|
+
* `creditConfigurator` for risk-parameter and adapter configuration.
|
|
20
|
+
*/
|
|
8
21
|
export declare class CreditSuite extends SDKConstruct {
|
|
22
|
+
/**
|
|
23
|
+
* Pool that supplies underlying liquidity to this credit manager.
|
|
24
|
+
*/
|
|
9
25
|
readonly pool: Address;
|
|
10
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Wrapper around the core credit manager contract.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* The credit manager owns account accounting, collateral checks, enabled
|
|
31
|
+
* collateral token masks, adapter mappings, debt updates, and liquidation
|
|
32
|
+
* calculations for this branch.
|
|
33
|
+
*/
|
|
11
34
|
readonly creditManager: ICreditManagerContract;
|
|
35
|
+
/**
|
|
36
|
+
* Wrapper around the credit facade contract used to build account
|
|
37
|
+
* transactions such as open, close, liquidate, and multicall.
|
|
38
|
+
*/
|
|
12
39
|
readonly creditFacade: CreditFacadeContract;
|
|
40
|
+
/**
|
|
41
|
+
* Wrapper around the credit configurator that mutates risk
|
|
42
|
+
* parameters, collateral tokens, adapter permissions, and facade settings.
|
|
43
|
+
*/
|
|
13
44
|
readonly creditConfigurator: ICreditConfiguratorContract;
|
|
14
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Original compressor contract snapshot for this credit suite.
|
|
47
|
+
*/
|
|
15
48
|
readonly state: CreditSuiteState;
|
|
49
|
+
/**
|
|
50
|
+
* Human-readable credit manager name from the core contract state.
|
|
51
|
+
*/
|
|
16
52
|
readonly name: string;
|
|
17
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Creates a credit suite from one entry in a market compressor snapshot.
|
|
55
|
+
*
|
|
56
|
+
* @param sdk - Attached SDK instance.
|
|
57
|
+
* @param data - Parent market snapshot part that contains the credit suite data.
|
|
58
|
+
*/
|
|
59
|
+
constructor(sdk: OnchainSDK, data: CreditSuiteState);
|
|
60
|
+
/**
|
|
61
|
+
* Token borrowed from the pool and used as the account debt asset.
|
|
62
|
+
*/
|
|
63
|
+
get underlying(): Address;
|
|
64
|
+
/**
|
|
65
|
+
* Parent market that contains this credit manager
|
|
66
|
+
*/
|
|
67
|
+
get market(): MarketSuite;
|
|
68
|
+
/**
|
|
69
|
+
* Market configurator that governs this credit suite and its parent pool.
|
|
70
|
+
*/
|
|
71
|
+
get marketConfigurator(): MarketConfiguratorContract;
|
|
72
|
+
/**
|
|
73
|
+
* Router configured for this credit suite.
|
|
74
|
+
*/
|
|
18
75
|
get router(): IRouterContract;
|
|
76
|
+
/**
|
|
77
|
+
* Whether this suite's facade is past its configured expiration timestamp.
|
|
78
|
+
*
|
|
79
|
+
* @remarks
|
|
80
|
+
* Expired credit suites can have different liquidation parameters on-chain.
|
|
81
|
+
* Non-expirable facades and facades with zero expiration are treated as not
|
|
82
|
+
* expired.
|
|
83
|
+
*/
|
|
19
84
|
get isExpired(): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Whether the facade, manager, or configurator has observed logs that require
|
|
87
|
+
* a credit-suite resync.
|
|
88
|
+
*/
|
|
20
89
|
get dirty(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Credit contracts whose events are enough to detect stale suite state.
|
|
92
|
+
*
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
21
95
|
get watchAddresses(): Set<Address>;
|
|
96
|
+
/**
|
|
97
|
+
* Returns a label-enriched, JSON-friendly view of this credit suite.
|
|
98
|
+
*
|
|
99
|
+
* @param raw - Whether child wrappers should keep raw numeric values instead
|
|
100
|
+
* of applying human formatting where they support both modes.
|
|
101
|
+
*/
|
|
22
102
|
stateHuman(raw?: boolean): CreditSuiteStateHuman;
|
|
23
103
|
}
|
|
@@ -9,20 +9,95 @@ import { GaugeContract } from "./GaugeContract.js";
|
|
|
9
9
|
import { LinearInterestRateModelContract } from "./LinearInterestRateModelContract.js";
|
|
10
10
|
import { TumblerContract } from "./TumblerContract.js";
|
|
11
11
|
import type { IInterestRateModelContract, IRateKeeperContract, PoolContract, PoolQuotaKeeperContract } from "./types.js";
|
|
12
|
+
/**
|
|
13
|
+
* SDK aggregate for the pool-side contracts of a Gearbox market.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* The pool is the market's passive liquidity source. This suite groups the
|
|
17
|
+
* ERC-4626 pool wrapper with the quota keeper that caps collateral-side
|
|
18
|
+
* exposure, the rate keeper that supplies quota rates, and the interest-rate
|
|
19
|
+
* model that prices pool utilization. Higher-level market and pool services use
|
|
20
|
+
* this class when they need the complete pool control plane instead of a single
|
|
21
|
+
* contract wrapper.
|
|
22
|
+
*/
|
|
12
23
|
export declare class PoolSuite extends SDKConstruct {
|
|
13
24
|
#private;
|
|
25
|
+
/**
|
|
26
|
+
* ERC-4626 liquidity pool wrapper for deposits, withdrawals, borrowing
|
|
27
|
+
* limits, and base interest accounting.
|
|
28
|
+
*/
|
|
14
29
|
readonly pool: PoolContract;
|
|
30
|
+
/**
|
|
31
|
+
* Quota keeper wrapper that tracks per-token quota limits, quoted exposure,
|
|
32
|
+
* quota rates, and credit-manager access.
|
|
33
|
+
*/
|
|
15
34
|
readonly pqk: PoolQuotaKeeperContract;
|
|
35
|
+
/**
|
|
36
|
+
* Rate keeper used by the quota keeper to obtain collateral-specific quota
|
|
37
|
+
* rates. Can be a {@link GaugeContract} or a {@link TumblerContract}.
|
|
38
|
+
*/
|
|
16
39
|
readonly rateKeeper: IRateKeeperContract;
|
|
40
|
+
/**
|
|
41
|
+
* Interest-rate model used by the pool to calculate the base borrow rate from
|
|
42
|
+
* expected and available liquidity.
|
|
43
|
+
*/
|
|
17
44
|
readonly interestRateModel: IInterestRateModelContract;
|
|
45
|
+
/**
|
|
46
|
+
* Creates the pool aggregate from a market compressor snapshot.
|
|
47
|
+
*
|
|
48
|
+
* @param sdk - Attached SDK instance
|
|
49
|
+
* @param data - Full market snapshot containing pool, quota, rate, and
|
|
50
|
+
* interest-rate model state.
|
|
51
|
+
*/
|
|
18
52
|
constructor(sdk: OnchainSDK, data: MarketData);
|
|
53
|
+
/**
|
|
54
|
+
* Narrows `rateKeeper` to a gauge rate keeper.
|
|
55
|
+
*
|
|
56
|
+
* @throws If the market uses a different rate keeper type.
|
|
57
|
+
*/
|
|
19
58
|
get gauge(): GaugeContract;
|
|
59
|
+
/**
|
|
60
|
+
* Narrows `rateKeeper` to a tumbler rate keeper.
|
|
61
|
+
*
|
|
62
|
+
* @throws If the market uses a different rate keeper type.
|
|
63
|
+
*/
|
|
20
64
|
get tumbler(): TumblerContract;
|
|
65
|
+
/**
|
|
66
|
+
* Narrows `interestRateModel` to the linear interest-rate model.
|
|
67
|
+
*
|
|
68
|
+
* @throws If the market uses a different interest-rate model type.
|
|
69
|
+
*/
|
|
21
70
|
get linearModel(): LinearInterestRateModelContract;
|
|
71
|
+
/**
|
|
72
|
+
* Market configurator that governs the pool and its connected credit suites.
|
|
73
|
+
*
|
|
74
|
+
* @throws If the configurator is missing from the SDK contract register.
|
|
75
|
+
*/
|
|
22
76
|
get marketConfigurator(): MarketConfiguratorContract;
|
|
77
|
+
/**
|
|
78
|
+
* Underlying asset deposited into the pool and borrowed by connected credit
|
|
79
|
+
* suites.
|
|
80
|
+
*/
|
|
23
81
|
get underlying(): Address;
|
|
82
|
+
/**
|
|
83
|
+
* RWA factory associated with the pool's underlying, undefined for non-RWA markets.
|
|
84
|
+
*/
|
|
24
85
|
get rwaFactory(): IRWAFactory | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* Whether any pool-side wrapper has observed logs that require a resync.
|
|
88
|
+
*/
|
|
25
89
|
get dirty(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Pool-side contract addresses whose logs are enough to detect stale state.
|
|
92
|
+
*
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
26
95
|
get watchAddresses(): Set<Address>;
|
|
96
|
+
/**
|
|
97
|
+
* Returns a label-enriched, JSON-friendly view of the pool-side state.
|
|
98
|
+
*
|
|
99
|
+
* @param raw - Whether child wrappers should keep raw numeric values instead
|
|
100
|
+
* of applying human formatting where they support both modes.
|
|
101
|
+
*/
|
|
27
102
|
stateHuman(raw?: boolean): PoolSuiteStateHuman;
|
|
28
103
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ContractEventName, DecodeFunctionDataReturnType, Log } from "viem";
|
|
2
2
|
import type { CreditManagerDebtParams, PoolState } from "../../base/index.js";
|
|
3
3
|
import { BaseContract } from "../../base/index.js";
|
|
4
4
|
import type { OnchainSDK } from "../../OnchainSDK.js";
|
|
5
|
-
import type { PoolStateHuman
|
|
5
|
+
import type { PoolStateHuman } from "../../types/index.js";
|
|
6
6
|
import { AddressMap } from "../../utils/index.js";
|
|
7
7
|
import type { IRWAFactory } from "../rwa/types.js";
|
|
8
8
|
declare const abi: readonly [{
|
|
@@ -1138,16 +1138,6 @@ export declare class PoolV310Contract extends BaseContract<abi> {
|
|
|
1138
1138
|
get rwaFactory(): IRWAFactory | undefined;
|
|
1139
1139
|
stateHuman(raw?: boolean): PoolStateHuman;
|
|
1140
1140
|
processLog(log: Log<bigint, number, false, undefined, undefined, abi, ContractEventName<abi>>): void;
|
|
1141
|
-
/**
|
|
1142
|
-
* Deposits underlying assets into the pool on behalf of a user with a
|
|
1143
|
-
* referral code.
|
|
1144
|
-
*/
|
|
1145
|
-
depositWithReferral(amount: bigint, onBehalfOf: Address, referralCode: bigint): RawTx;
|
|
1146
|
-
/**
|
|
1147
|
-
* Redeems pool shares from the owner and sends the underlying assets to
|
|
1148
|
-
* the receiver.
|
|
1149
|
-
*/
|
|
1150
|
-
redeem(amount: bigint, owner: Address, receiver: Address): RawTx;
|
|
1151
1141
|
protected stringifyFunctionParams(params: DecodeFunctionDataReturnType<abi>): string[];
|
|
1152
1142
|
}
|
|
1153
1143
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import { SDKConstruct } from "../base/index.js";
|
|
3
|
-
import type { AddLiquidityProps, DepositMetadata, IPoolsService,
|
|
3
|
+
import type { AddLiquidityProps, DepositMetadata, IPoolsService, PoolServiceCall, RemoveLiquidityProps, WithdrawalMetadata } from "./types.js";
|
|
4
4
|
export declare class PoolService extends SDKConstruct implements IPoolsService {
|
|
5
5
|
#private;
|
|
6
6
|
/**
|
|
@@ -18,7 +18,7 @@ export declare class PoolService extends SDKConstruct implements IPoolsService {
|
|
|
18
18
|
/**
|
|
19
19
|
* {@inheritDoc IPoolsService.addLiquidity}
|
|
20
20
|
*/
|
|
21
|
-
addLiquidity(props: AddLiquidityProps):
|
|
21
|
+
addLiquidity(props: AddLiquidityProps): PoolServiceCall | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* {@inheritDoc IPoolsService.getWithdrawalTokensIn}
|
|
24
24
|
*/
|
|
@@ -30,7 +30,7 @@ export declare class PoolService extends SDKConstruct implements IPoolsService {
|
|
|
30
30
|
/**
|
|
31
31
|
* {@inheritDoc IPoolsService.removeLiquidity}
|
|
32
32
|
*/
|
|
33
|
-
removeLiquidity(props: RemoveLiquidityProps):
|
|
33
|
+
removeLiquidity(props: RemoveLiquidityProps): PoolServiceCall;
|
|
34
34
|
/**
|
|
35
35
|
* {@inheritDoc IPoolsService.getWithdrawalMetadata}
|
|
36
36
|
*/
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Abi, Address, ContractFunctionArgs, ContractFunctionName } from "viem";
|
|
2
2
|
import type { ZapperData } from "../market/index.js";
|
|
3
3
|
import type { Asset } from "../router/index.js";
|
|
4
|
-
import type { MultiCall, RawTx } from "../types/transactions.js";
|
|
5
4
|
interface PermitResult {
|
|
6
5
|
r: Address;
|
|
7
6
|
s: Address;
|
|
@@ -20,10 +19,6 @@ export type PoolServiceCall<abi extends Abi | readonly unknown[] = Abi, function
|
|
|
20
19
|
target: Address;
|
|
21
20
|
value?: bigint;
|
|
22
21
|
};
|
|
23
|
-
export interface PoolServiceCallResult {
|
|
24
|
-
tx: RawTx;
|
|
25
|
-
calls: Array<MultiCall>;
|
|
26
|
-
}
|
|
27
22
|
export interface AddLiquidityProps {
|
|
28
23
|
/**
|
|
29
24
|
* Token and amount to deposit.
|
|
@@ -151,13 +146,13 @@ export interface IPoolsService {
|
|
|
151
146
|
* @param props - {@link AddLiquidityProps}
|
|
152
147
|
* @returns - {@link AddLiquidityCall}
|
|
153
148
|
*/
|
|
154
|
-
addLiquidity(props: AddLiquidityProps):
|
|
149
|
+
addLiquidity(props: AddLiquidityProps): PoolServiceCall | undefined;
|
|
155
150
|
/**
|
|
156
151
|
* Construct a call to remove liquidity from a Gearbox lending pool.
|
|
157
152
|
*
|
|
158
153
|
* @param props - {@link RemoveLiquidityProps}
|
|
159
154
|
* @returns - {@link RemoveLiquidityCall}
|
|
160
155
|
*/
|
|
161
|
-
removeLiquidity(props: RemoveLiquidityProps):
|
|
156
|
+
removeLiquidity(props: RemoveLiquidityProps): PoolServiceCall;
|
|
162
157
|
}
|
|
163
158
|
export {};
|
package/package.json
CHANGED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var IERC20ZapperDepositsContract_exports = {};
|
|
20
|
-
__export(IERC20ZapperDepositsContract_exports, {
|
|
21
|
-
IERC20ZapperDepositsContract: () => IERC20ZapperDepositsContract
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(IERC20ZapperDepositsContract_exports);
|
|
24
|
-
var import_iERC20ZapperDeposits = require("../../../abi/iERC20ZapperDeposits.js");
|
|
25
|
-
var import_base = require("../../base/index.js");
|
|
26
|
-
const abi = import_iERC20ZapperDeposits.ierc20ZapperDepositsAbi;
|
|
27
|
-
class IERC20ZapperDepositsContract extends import_base.BaseContract {
|
|
28
|
-
constructor(options, args) {
|
|
29
|
-
super(options, { ...args, abi });
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Deposits ERC20 tokens into the pool via this zapper using a referral code.
|
|
33
|
-
*/
|
|
34
|
-
depositWithReferral(tokenInAmount, receiver, referralCode) {
|
|
35
|
-
return this.createRawTx({
|
|
36
|
-
functionName: "depositWithReferral",
|
|
37
|
-
args: [tokenInAmount, receiver, referralCode]
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Deposits ERC20 tokens via this zapper with a referral code and an
|
|
42
|
-
* EIP-2612 permit signature, skipping a separate approve transaction.
|
|
43
|
-
*/
|
|
44
|
-
depositWithReferralAndPermit(tokenInAmount, receiver, referralCode, deadline, v, r, s) {
|
|
45
|
-
return this.createRawTx({
|
|
46
|
-
functionName: "depositWithReferralAndPermit",
|
|
47
|
-
args: [tokenInAmount, receiver, referralCode, deadline, v, r, s]
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
-
0 && (module.exports = {
|
|
53
|
-
IERC20ZapperDepositsContract
|
|
54
|
-
});
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var IETHZapperDepositsContract_exports = {};
|
|
20
|
-
__export(IETHZapperDepositsContract_exports, {
|
|
21
|
-
IETHZapperDepositsContract: () => IETHZapperDepositsContract
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(IETHZapperDepositsContract_exports);
|
|
24
|
-
var import_iETHZapperDeposits = require("../../../abi/iETHZapperDeposits.js");
|
|
25
|
-
var import_base = require("../../base/index.js");
|
|
26
|
-
const abi = import_iETHZapperDeposits.iethZapperDepositsAbi;
|
|
27
|
-
class IETHZapperDepositsContract extends import_base.BaseContract {
|
|
28
|
-
constructor(options, args) {
|
|
29
|
-
super(options, { ...args, abi });
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Deposits native ETH into the pool via this zapper using a referral code.
|
|
33
|
-
* The caller must attach the deposit amount as msg.value.
|
|
34
|
-
*/
|
|
35
|
-
depositWithReferral(receiver, referralCode) {
|
|
36
|
-
return this.createRawTx({
|
|
37
|
-
functionName: "depositWithReferral",
|
|
38
|
-
args: [receiver, referralCode]
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
43
|
-
0 && (module.exports = {
|
|
44
|
-
IETHZapperDepositsContract
|
|
45
|
-
});
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var IZapperContract_exports = {};
|
|
20
|
-
__export(IZapperContract_exports, {
|
|
21
|
-
IZapperContract: () => IZapperContract
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(IZapperContract_exports);
|
|
24
|
-
var import_iZapper = require("../../../abi/iZapper.js");
|
|
25
|
-
var import_base = require("../../base/index.js");
|
|
26
|
-
const abi = import_iZapper.iZapperAbi;
|
|
27
|
-
class IZapperContract extends import_base.BaseContract {
|
|
28
|
-
constructor(options, args) {
|
|
29
|
-
super(options, { ...args, abi });
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Redeems pool shares (diesel tokens) for the underlying asset via this zapper.
|
|
33
|
-
*/
|
|
34
|
-
redeem(tokenInAmount, receiver) {
|
|
35
|
-
return this.createRawTx({
|
|
36
|
-
functionName: "redeem",
|
|
37
|
-
args: [tokenInAmount, receiver]
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Redeems pool shares via this zapper with an EIP-2612 permit signature,
|
|
42
|
-
* skipping a separate approve transaction.
|
|
43
|
-
*/
|
|
44
|
-
redeemWithPermit(tokenInAmount, receiver, deadline, v, r, s) {
|
|
45
|
-
return this.createRawTx({
|
|
46
|
-
functionName: "redeemWithPermit",
|
|
47
|
-
args: [tokenInAmount, receiver, deadline, v, r, s]
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
-
0 && (module.exports = {
|
|
53
|
-
IZapperContract
|
|
54
|
-
});
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var zapper_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(zapper_exports);
|
|
18
|
-
__reExport(zapper_exports, require("./IERC20ZapperDepositsContract.js"), module.exports);
|
|
19
|
-
__reExport(zapper_exports, require("./IETHZapperDepositsContract.js"), module.exports);
|
|
20
|
-
__reExport(zapper_exports, require("./IZapperContract.js"), module.exports);
|
|
21
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
-
0 && (module.exports = {
|
|
23
|
-
...require("./IERC20ZapperDepositsContract.js"),
|
|
24
|
-
...require("./IETHZapperDepositsContract.js"),
|
|
25
|
-
...require("./IZapperContract.js")
|
|
26
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { ierc20ZapperDepositsAbi } from "../../../abi/iERC20ZapperDeposits.js";
|
|
2
|
-
import { BaseContract } from "../../base/index.js";
|
|
3
|
-
const abi = ierc20ZapperDepositsAbi;
|
|
4
|
-
class IERC20ZapperDepositsContract extends BaseContract {
|
|
5
|
-
constructor(options, args) {
|
|
6
|
-
super(options, { ...args, abi });
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Deposits ERC20 tokens into the pool via this zapper using a referral code.
|
|
10
|
-
*/
|
|
11
|
-
depositWithReferral(tokenInAmount, receiver, referralCode) {
|
|
12
|
-
return this.createRawTx({
|
|
13
|
-
functionName: "depositWithReferral",
|
|
14
|
-
args: [tokenInAmount, receiver, referralCode]
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Deposits ERC20 tokens via this zapper with a referral code and an
|
|
19
|
-
* EIP-2612 permit signature, skipping a separate approve transaction.
|
|
20
|
-
*/
|
|
21
|
-
depositWithReferralAndPermit(tokenInAmount, receiver, referralCode, deadline, v, r, s) {
|
|
22
|
-
return this.createRawTx({
|
|
23
|
-
functionName: "depositWithReferralAndPermit",
|
|
24
|
-
args: [tokenInAmount, receiver, referralCode, deadline, v, r, s]
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
IERC20ZapperDepositsContract
|
|
30
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { iethZapperDepositsAbi } from "../../../abi/iETHZapperDeposits.js";
|
|
2
|
-
import { BaseContract } from "../../base/index.js";
|
|
3
|
-
const abi = iethZapperDepositsAbi;
|
|
4
|
-
class IETHZapperDepositsContract extends BaseContract {
|
|
5
|
-
constructor(options, args) {
|
|
6
|
-
super(options, { ...args, abi });
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Deposits native ETH into the pool via this zapper using a referral code.
|
|
10
|
-
* The caller must attach the deposit amount as msg.value.
|
|
11
|
-
*/
|
|
12
|
-
depositWithReferral(receiver, referralCode) {
|
|
13
|
-
return this.createRawTx({
|
|
14
|
-
functionName: "depositWithReferral",
|
|
15
|
-
args: [receiver, referralCode]
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
IETHZapperDepositsContract
|
|
21
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { iZapperAbi } from "../../../abi/iZapper.js";
|
|
2
|
-
import { BaseContract } from "../../base/index.js";
|
|
3
|
-
const abi = iZapperAbi;
|
|
4
|
-
class IZapperContract extends BaseContract {
|
|
5
|
-
constructor(options, args) {
|
|
6
|
-
super(options, { ...args, abi });
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Redeems pool shares (diesel tokens) for the underlying asset via this zapper.
|
|
10
|
-
*/
|
|
11
|
-
redeem(tokenInAmount, receiver) {
|
|
12
|
-
return this.createRawTx({
|
|
13
|
-
functionName: "redeem",
|
|
14
|
-
args: [tokenInAmount, receiver]
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Redeems pool shares via this zapper with an EIP-2612 permit signature,
|
|
19
|
-
* skipping a separate approve transaction.
|
|
20
|
-
*/
|
|
21
|
-
redeemWithPermit(tokenInAmount, receiver, deadline, v, r, s) {
|
|
22
|
-
return this.createRawTx({
|
|
23
|
-
functionName: "redeemWithPermit",
|
|
24
|
-
args: [tokenInAmount, receiver, deadline, v, r, s]
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export {
|
|
29
|
-
IZapperContract
|
|
30
|
-
};
|