@1delta/calldatalib 0.0.33 → 0.0.35
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/package.json +2 -2
- package/dist/CalldataLib.d.ts +0 -180
- package/dist/CalldataLib.js +0 -839
- package/dist/cjs/CalldataLib.d.ts +0 -180
- package/dist/cjs/index.d.ts +0 -2
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/utils.d.ts +0 -19
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -2
- package/dist/utils.d.ts +0 -19
- package/dist/utils.js +0 -61
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1delta/calldatalib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"description": "Generated CalldataLib TypeScript functions for 1delta smart contracts",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cjs/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"import": "./dist/esm/index.js",
|
|
12
12
|
"require": "./dist/cjs/index.js",
|
|
13
|
-
"types": "./dist/index.d.ts"
|
|
13
|
+
"types": "./dist/types/index.d.ts"
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
package/dist/CalldataLib.d.ts
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { type Hex, type Address } from "viem";
|
|
2
|
-
export declare enum SweepType {
|
|
3
|
-
VALIDATE = 0,
|
|
4
|
-
AMOUNT = 1
|
|
5
|
-
}
|
|
6
|
-
export declare enum DexPayConfig {
|
|
7
|
-
CALLER_PAYS = 0,
|
|
8
|
-
CONTRACT_PAYS = 1,
|
|
9
|
-
PRE_FUND = 2,
|
|
10
|
-
FLASH = 3
|
|
11
|
-
}
|
|
12
|
-
export declare enum DodoSelector {
|
|
13
|
-
SELL_BASE = 0,
|
|
14
|
-
SELL_QUOTE = 1
|
|
15
|
-
}
|
|
16
|
-
export declare enum WrapOperation {
|
|
17
|
-
NATIVE = 0,
|
|
18
|
-
ERC4626_DEPOSIT = 1,
|
|
19
|
-
ERC4626_REDEEM = 2
|
|
20
|
-
}
|
|
21
|
-
export declare enum TransferIds {
|
|
22
|
-
TRANSFER_FROM = 0,
|
|
23
|
-
SWEEP = 1,
|
|
24
|
-
WRAP_NATIVE = 2,
|
|
25
|
-
UNWRAP_WNATIVE = 3,
|
|
26
|
-
PERMIT2_TRANSFER_FROM = 4,
|
|
27
|
-
APPROVE = 5
|
|
28
|
-
}
|
|
29
|
-
export declare enum PermitIds {
|
|
30
|
-
TOKEN_PERMIT = 0,
|
|
31
|
-
AAVE_V3_CREDIT_PERMIT = 1,
|
|
32
|
-
ALLOW_CREDIT_PERMIT = 2
|
|
33
|
-
}
|
|
34
|
-
export declare enum LenderIds {
|
|
35
|
-
UP_TO_AAVE_V3 = 1000,
|
|
36
|
-
UP_TO_AAVE_V2 = 2000,
|
|
37
|
-
UP_TO_COMPOUND_V3 = 3000,
|
|
38
|
-
UP_TO_COMPOUND_V2 = 4000,
|
|
39
|
-
UP_TO_MORPHO = 5000
|
|
40
|
-
}
|
|
41
|
-
export declare enum LenderOps {
|
|
42
|
-
DEPOSIT = 0,
|
|
43
|
-
BORROW = 1,
|
|
44
|
-
REPAY = 2,
|
|
45
|
-
WITHDRAW = 3,
|
|
46
|
-
DEPOSIT_LENDING_TOKEN = 4,
|
|
47
|
-
WITHDRAW_LENDING_TOKEN = 5
|
|
48
|
-
}
|
|
49
|
-
export declare enum FlashLoanIds {
|
|
50
|
-
MORPHO = 0,
|
|
51
|
-
BALANCER_V2 = 1,
|
|
52
|
-
AAVE_V3 = 2,
|
|
53
|
-
AAVE_V2 = 3
|
|
54
|
-
}
|
|
55
|
-
export declare enum ERC4626Ids {
|
|
56
|
-
DEPOSIT = 0,
|
|
57
|
-
WITHDRAW = 1
|
|
58
|
-
}
|
|
59
|
-
export declare enum Gen2025ActionIds {
|
|
60
|
-
UNLOCK = 0,
|
|
61
|
-
UNI_V4_TAKE = 1,
|
|
62
|
-
UNI_V4_SETTLE = 2,
|
|
63
|
-
UNI_V4_SYNC = 3,
|
|
64
|
-
BAL_V3_TAKE = 4,
|
|
65
|
-
BAL_V3_SETTLE = 5
|
|
66
|
-
}
|
|
67
|
-
export declare enum ComposerCommands {
|
|
68
|
-
SWAPS = 16,
|
|
69
|
-
EXT_CALL = 32,
|
|
70
|
-
EXT_TRY_CALL = 33,
|
|
71
|
-
LENDING = 48,
|
|
72
|
-
TRANSFERS = 64,
|
|
73
|
-
PERMIT = 80,
|
|
74
|
-
FLASH_LOAN = 96,
|
|
75
|
-
ERC4626 = 112,
|
|
76
|
-
GEN_2025_SINGELTONS = 128,
|
|
77
|
-
BRIDGING = 144
|
|
78
|
-
}
|
|
79
|
-
export declare enum BridgeIds {
|
|
80
|
-
STARGATE_V2 = 0,
|
|
81
|
-
ACROSS = 10
|
|
82
|
-
}
|
|
83
|
-
export declare enum DexTypeMappings {
|
|
84
|
-
UNISWAP_V3_ID = 0,
|
|
85
|
-
UNISWAP_V2_ID = 1,
|
|
86
|
-
UNISWAP_V4_ID = 2,
|
|
87
|
-
IZI_ID = 5,
|
|
88
|
-
UNISWAP_V2_FOT_ID = 3,
|
|
89
|
-
CURVE_V1_STANDARD_ID = 64,
|
|
90
|
-
CURVE_RECEIVED_ID = 65,
|
|
91
|
-
CURVE_FORK_ID = 66,
|
|
92
|
-
WOO_FI_ID = 80,
|
|
93
|
-
GMX_ID = 90,
|
|
94
|
-
KTX_ID = 91,
|
|
95
|
-
BALANCER_V2_ID = 128,
|
|
96
|
-
BALANCER_V3_ID = 129,
|
|
97
|
-
LB_ID = 140,
|
|
98
|
-
DODO_ID = 150,
|
|
99
|
-
SYNC_SWAP_ID = 160,
|
|
100
|
-
ERC4626_ID = 253,
|
|
101
|
-
ASSET_WRAP_ID = 254
|
|
102
|
-
}
|
|
103
|
-
export declare enum DexForkMappings {
|
|
104
|
-
UNISWAP_V3 = 0,
|
|
105
|
-
IZI = 0,
|
|
106
|
-
ANY_V3 = 255,
|
|
107
|
-
ANY_IZI = 255,
|
|
108
|
-
UNISWAP_V4 = 0,
|
|
109
|
-
BALANCER_V3 = 0,
|
|
110
|
-
UNISWAP_V2 = 0
|
|
111
|
-
}
|
|
112
|
-
export declare function encodeExternalCall(target: Address, value: bigint, useSelfBalance: boolean, data: Hex): Hex;
|
|
113
|
-
export declare function encodeTryExternalCall(target: Address, value: bigint, useSelfBalance: boolean, rOnFailure: boolean, data: Hex, catchData: Hex): Hex;
|
|
114
|
-
export declare function encodeStargateV2Bridge(asset: Address, stargatePool: Address, dstEid: number, receiver: Hex, refundReceiver: Address, amount: bigint, slippage: number, fee: bigint, isBusMode: boolean, isNative: boolean, composeMsg: Hex, extraOptions: Hex): Hex;
|
|
115
|
-
export declare function encodeStargateV2BridgePartial(amount: bigint, slippage: number, fee: bigint, isBusMode: boolean, isNative: boolean, composeMsg: Hex, extraOptions: Hex): Hex;
|
|
116
|
-
export declare function encodeStargateV2BridgeSimpleTaxi(asset: Address, stargatePool: Address, dstEid: number, receiver: Hex, refundReceiver: Address, amount: bigint, isNative: boolean, slippage: number, fee: bigint): Hex;
|
|
117
|
-
export declare function encodeStargateV2BridgeSimpleBus(asset: Address, stargatePool: Address, dstEid: number, receiver: Hex, refundReceiver: Address, amount: bigint, isNative: boolean, slippage: number, fee: bigint): Hex;
|
|
118
|
-
export declare function encodeAcrossBridgeToken(spokePool: Address, depositor: Address, sendingAssetId: Address, receivingAssetId: Address, amount: bigint, fixedFee: bigint, feePercentage: number, destinationChainId: number, receiver: Address, message: Hex): Hex;
|
|
119
|
-
export declare function encodeAcrossBridgeNative(spokePool: Address, depositor: Address, sendingAssetId: Address, receivingAssetId: Address, amount: bigint, fixedFee: bigint, feePercentage: number, destinationChainId: number, receiver: Address, message: Hex): Hex;
|
|
120
|
-
export declare function encodePermit2TransferFrom(token: Address, receiver: Address, amount: bigint): Hex;
|
|
121
|
-
export declare function encodeNextGenDexUnlock(singleton: Address, id: bigint, d: Hex): Hex;
|
|
122
|
-
export declare function encodeBalancerV3FlashLoan(singleton: Address, poolId: bigint, asset: Address, receiver: Address, amount: bigint, flashData: Hex): Hex;
|
|
123
|
-
export declare function encodeBalancerV3FlashLoanData(take: Hex, flashData: Hex, settle: Hex): Hex;
|
|
124
|
-
export declare function encodeUniswapV4FlashLoan(singleton: Address, poolId: bigint, asset: Address, receiver: Address, amount: bigint, flashData: Hex): Hex;
|
|
125
|
-
export declare function encodeUniswapV4FlashLoanData(take: Hex, sync: Hex, flashData: Hex, settle: Hex): Hex;
|
|
126
|
-
export declare function encodeBalancerV3Take(singleton: Address, asset: Address, receiver: Address, amount: bigint): Hex;
|
|
127
|
-
export declare function encodeUniswapV4Sync(singleton: Address, asset: Address): Hex;
|
|
128
|
-
export declare function encodeUniswapV4Take(singleton: Address, asset: Address, receiver: Address, amount: bigint): Hex;
|
|
129
|
-
export declare function swapHead(amount: bigint, amountOutMin: bigint, assetIn: Address): Hex;
|
|
130
|
-
export declare function attachBranch(data: Hex, hops: bigint, splits: bigint, splitsData: Hex): Hex;
|
|
131
|
-
export declare function encodeUniswapV2StyleSwap(tokenOut: Address, receiver: Address, forkId: bigint, pool: Address, feeDenom: bigint, cfg: any, flashCalldata: Hex): Hex;
|
|
132
|
-
export declare function encodeUniswapV4StyleSwap(currentData: Hex, tokenOut: Address, receiver: Address, manager: Address, fee: number, tickSpacing: number, hooks: Address, hookData: Hex, cfg: any): Hex;
|
|
133
|
-
export declare function encodeBalancerV2StyleSwap(currentData: Hex, tokenOut: Address, receiver: Address, poolId: Hex, balancerVault: Address, cfg: any): Hex;
|
|
134
|
-
export declare function encodeLbStyleSwap(currentData: Hex, tokenOut: Address, receiver: Address, pool: Address, swapForY: boolean, cfg: any): Hex;
|
|
135
|
-
export declare function encodeSyncSwapStyleSwap(currentData: Hex, tokenOut: Address, receiver: Address, pool: Address, cfg: any): Hex;
|
|
136
|
-
export declare function encodeUniswapV3StyleSwap(currentData: Hex, tokenOut: Address, receiver: Address, forkId: bigint, pool: Address, feeTier: bigint, cfg: any, flashCalldata: Hex): Hex;
|
|
137
|
-
export declare function encodeIzumiStyleSwap(currentData: Hex, tokenOut: Address, receiver: Address, forkId: bigint, pool: Address, feeTier: bigint, cfg: any, flashCalldata: Hex): Hex;
|
|
138
|
-
export declare function encodeBalancerV3StyleSwap(currentData: Hex, tokenOut: Address, receiver: Address, balancerV3Vault: Address, pool: Address, cfg: any, poolUserData: Hex): Hex;
|
|
139
|
-
export declare function encodeDodoStyleSwap(currentData: Hex, tokenOut: Address, receiver: Address, pool: Address, selector: any, poolId: bigint, cfg: any, flashCalldata: Hex): Hex;
|
|
140
|
-
export declare function encodeWooStyleSwap(currentData: Hex, tokenOut: Address, receiver: Address, pool: Address, cfg: any): Hex;
|
|
141
|
-
export declare function encodeGmxStyleSwap(currentData: Hex, tokenOut: Address, receiver: Address, pool: Address, cfg: any): Hex;
|
|
142
|
-
export declare function encodeKtxStyleSwap(currentData: Hex, tokenOut: Address, receiver: Address, pool: Address, cfg: any): Hex;
|
|
143
|
-
export declare function encodeCurveStyleSwap(tokenOut: Address, receiver: Address, pool: Address, indexIn: bigint, indexOut: bigint, selectorId: bigint, cfg: any): Hex;
|
|
144
|
-
export declare function encodeCurveNGStyleSwap(tokenOut: Address, receiver: Address, pool: Address, indexIn: bigint, indexOut: bigint, selectorId: bigint, cfg: any): Hex;
|
|
145
|
-
export declare function encodeWrapperSwap(currentData: Hex, assetOut: Address, receiver: Address, operation: any, cfg: any): Hex;
|
|
146
|
-
export declare function encodeNextGenDexSettle(singleton: Address, nativeAmount: bigint): Hex;
|
|
147
|
-
export declare function encodeNextGenDexSettleBalancer(singleton: Address, asset: Address, amountHint: bigint): Hex;
|
|
148
|
-
export declare function encodeTransferIn(asset: Address, receiver: Address, amount: bigint): Hex;
|
|
149
|
-
export declare function encodeSweep(asset: Address, receiver: Address, amount: bigint, sweepType: any): Hex;
|
|
150
|
-
export declare function encodeWrap(amount: bigint, wrapTarget: Address): Hex;
|
|
151
|
-
export declare function encodeApprove(asset: Address, target: Address): Hex;
|
|
152
|
-
export declare function encodeUnwrap(target: Address, receiver: Address, amount: bigint, sweepType: any): Hex;
|
|
153
|
-
export declare function encodeBalancerV2FlashLoan(asset: Address, amount: bigint, poolId: number, data: Hex): Hex;
|
|
154
|
-
export declare function encodeFlashLoan(asset: Address, amount: bigint, pool: Address, poolType: number, poolId: number, data: Hex): Hex;
|
|
155
|
-
export declare function encodeUint8AndBytes(poolId: number, data: Hex): Hex;
|
|
156
|
-
export declare function encodeMorphoMarket(loanToken: Address, collateralToken: Address, oracle: Address, irm: Address, lltv: bigint): Hex;
|
|
157
|
-
export declare function encodeMorphoDepositCollateral(market: Hex, assets: bigint, receiver: Address, data: Hex, morphoB: Address, pId: bigint): Hex;
|
|
158
|
-
export declare function encodeMorphoDeposit(market: Hex, isShares: boolean, assets: bigint, receiver: Address, data: Hex, morphoB: Address, pId: bigint): Hex;
|
|
159
|
-
export declare function encodeErc4646Deposit(asset: Address, vault: Address, isShares: boolean, assets: bigint, receiver: Address): Hex;
|
|
160
|
-
export declare function encodeErc4646Withdraw(vault: Address, isShares: boolean, assets: bigint, receiver: Address): Hex;
|
|
161
|
-
export declare function encodeMorphoWithdraw(market: Hex, isShares: boolean, assets: bigint, receiver: Address, morphoB: Address): Hex;
|
|
162
|
-
export declare function encodeMorphoWithdrawCollateral(market: Hex, assets: bigint, receiver: Address, morphoB: Address): Hex;
|
|
163
|
-
export declare function encodeMorphoBorrow(market: Hex, isShares: boolean, assets: bigint, receiver: Address, morphoB: Address): Hex;
|
|
164
|
-
export declare function encodeMorphoRepay(market: Hex, isShares: boolean, unsafe: boolean, assets: bigint, receiver: Address, data: Hex, morphoB: Address, pId: bigint): Hex;
|
|
165
|
-
export declare function encodeAaveDeposit(token: Address, amount: bigint, receiver: Address, pool: Address): Hex;
|
|
166
|
-
export declare function encodeAaveBorrow(token: Address, amount: bigint, receiver: Address, mode: bigint, pool: Address): Hex;
|
|
167
|
-
export declare function encodeAaveRepay(token: Address, amount: bigint, receiver: Address, mode: bigint, dToken: Address, pool: Address): Hex;
|
|
168
|
-
export declare function encodeAaveWithdraw(token: Address, amount: bigint, receiver: Address, aToken: Address, pool: Address): Hex;
|
|
169
|
-
export declare function encodeAaveV2Deposit(token: Address, amount: bigint, receiver: Address, pool: Address): Hex;
|
|
170
|
-
export declare function encodeAaveV2Borrow(token: Address, amount: bigint, receiver: Address, mode: bigint, pool: Address): Hex;
|
|
171
|
-
export declare function encodeAaveV2Repay(token: Address, amount: bigint, receiver: Address, mode: bigint, dToken: Address, pool: Address): Hex;
|
|
172
|
-
export declare function encodeAaveV2Withdraw(token: Address, amount: bigint, receiver: Address, aToken: Address, pool: Address): Hex;
|
|
173
|
-
export declare function encodeCompoundV3Deposit(token: Address, amount: bigint, receiver: Address, comet: Address): Hex;
|
|
174
|
-
export declare function encodeCompoundV3Borrow(token: Address, amount: bigint, receiver: Address, comet: Address): Hex;
|
|
175
|
-
export declare function encodeCompoundV3Repay(token: Address, amount: bigint, receiver: Address, comet: Address): Hex;
|
|
176
|
-
export declare function encodeCompoundV3Withdraw(token: Address, amount: bigint, receiver: Address, comet: Address, isBase: boolean): Hex;
|
|
177
|
-
export declare function encodeCompoundV2Deposit(token: Address, amount: bigint, receiver: Address, cToken: Address): Hex;
|
|
178
|
-
export declare function encodeCompoundV2Borrow(token: Address, amount: bigint, receiver: Address, cToken: Address): Hex;
|
|
179
|
-
export declare function encodeCompoundV2Repay(token: Address, amount: bigint, receiver: Address, cToken: Address): Hex;
|
|
180
|
-
export declare function encodeCompoundV2Withdraw(token: Address, amount: bigint, receiver: Address, cToken: Address): Hex;
|