@pufferfinance/puffer-sdk 1.5.4 → 1.6.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.
- package/dist/api/puffer-client-helpers.d.ts +33 -0
- package/dist/api/puffer-client.d.ts +52 -0
- package/dist/chains/constants.d.ts +11 -0
- package/dist/contracts/abis/holesky/PufferDepositor.d.ts +283 -0
- package/dist/contracts/abis/holesky/PufferVaultV2.d.ts +1361 -0
- package/dist/contracts/abis/l1-reward-manager-abis.d.ts +527 -0
- package/dist/contracts/abis/l2-reward-manager-abis.d.ts +709 -0
- package/dist/contracts/abis/mainnet/ERC20Permit.d.ts +396 -0
- package/dist/contracts/abis/mainnet/L1RewardManager.d.ts +523 -0
- package/dist/contracts/abis/mainnet/L2RewardManager.d.ts +705 -0
- package/dist/contracts/abis/mainnet/PufLocker.d.ts +480 -0
- package/dist/contracts/abis/mainnet/PufToken.d.ts +676 -0
- package/dist/contracts/abis/mainnet/PufferDepositor.d.ts +283 -0
- package/dist/contracts/abis/mainnet/PufferL2Depositor.d.ts +373 -0
- package/dist/contracts/abis/mainnet/PufferVaultV2.d.ts +1421 -0
- package/dist/contracts/abis/mainnet/PufferWithdrawalManager.d.ts +510 -0
- package/dist/contracts/abis/puf-locker-abis.d.ts +484 -0
- package/dist/contracts/abis/puf-token-abis.d.ts +680 -0
- package/dist/contracts/abis/puffer-depositor-abis.d.ts +664 -0
- package/dist/contracts/abis/puffer-vault-abis.d.ts +2787 -0
- package/dist/contracts/abis/puffer-withdrawal-manager-abis.d.ts +514 -0
- package/dist/contracts/abis/tokens-abis.d.ts +396 -0
- package/dist/contracts/addresses.d.ts +11 -0
- package/dist/contracts/handlers/erc20-permit-handler.d.ts +6580 -0
- package/dist/contracts/handlers/l1-reward-manager-handler.d.ts +6693 -0
- package/dist/contracts/handlers/l2-reward-manager-handler.d.ts +6939 -0
- package/dist/contracts/handlers/puf-locker-handler.d.ts +6702 -0
- package/dist/contracts/handlers/puf-token-handler.d.ts +6920 -0
- package/dist/contracts/handlers/puffer-depositor-handler.d.ts +6462 -0
- package/dist/contracts/handlers/puffer-l2-depositor-handler.d.ts +6555 -0
- package/dist/contracts/handlers/puffer-vault-handler.d.ts +9030 -0
- package/dist/contracts/handlers/puffer-withdrawal-manager-handler.d.ts +6697 -0
- package/dist/contracts/tokens.d.ts +52 -0
- package/dist/errors/base-error.d.ts +7 -0
- package/dist/errors/types.d.ts +4 -0
- package/dist/errors/validation-errors.d.ts +5 -0
- package/dist/main.d.ts +14 -0
- package/dist/utils/time.d.ts +1 -0
- package/dist/utils/types.d.ts +4 -0
- package/dist/utils/version.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CustomTransportConfig, PublicClient, WalletClient } from 'viem';
|
|
2
|
+
import { Chain } from '../chains/constants';
|
|
3
|
+
import { TransportProvider } from '../utils/types';
|
|
4
|
+
export type ClientConfig = {
|
|
5
|
+
chain: Chain;
|
|
6
|
+
} & ({
|
|
7
|
+
rpcUrls: string[];
|
|
8
|
+
} | {
|
|
9
|
+
provider: TransportProvider;
|
|
10
|
+
config?: CustomTransportConfig;
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Helper methods for the main `PufferClient`.
|
|
14
|
+
*/
|
|
15
|
+
export declare class PufferClientHelpers {
|
|
16
|
+
/**
|
|
17
|
+
* Helper method for creating a public client based on the
|
|
18
|
+
* configuration
|
|
19
|
+
*
|
|
20
|
+
* @param config Configuration for the public client.
|
|
21
|
+
* @returns The public client created with viem.
|
|
22
|
+
*/
|
|
23
|
+
static createPublicClient(config: ClientConfig): PublicClient;
|
|
24
|
+
/**
|
|
25
|
+
* Helper method for creating a wallet client based on the
|
|
26
|
+
* configuration
|
|
27
|
+
*
|
|
28
|
+
* @param config Configuration for the wallet client.
|
|
29
|
+
* @returns The wallet client created with viem.
|
|
30
|
+
*/
|
|
31
|
+
static createWalletClient(config: ClientConfig): WalletClient;
|
|
32
|
+
private static extractTransportConfig;
|
|
33
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PublicClient, WalletClient } from 'viem';
|
|
2
|
+
import { Chain } from '../chains/constants';
|
|
3
|
+
import { PufferVaultHandler } from '../contracts/handlers/puffer-vault-handler';
|
|
4
|
+
import { PufferDepositorHandler } from '../contracts/handlers/puffer-depositor-handler';
|
|
5
|
+
import { PufTokenHandler } from '../contracts/handlers/puf-token-handler';
|
|
6
|
+
import { PufferL2DepositorHandler } from '../contracts/handlers/puffer-l2-depositor-handler';
|
|
7
|
+
import { ERC20PermitHandler } from '../contracts/handlers/erc20-permit-handler';
|
|
8
|
+
import { PufLockerHandler } from '../contracts/handlers/puf-locker-handler';
|
|
9
|
+
import { L2RewardManagerHandler } from '../contracts/handlers/l2-reward-manager-handler';
|
|
10
|
+
import { L1RewardManagerHandler } from '../contracts/handlers/l1-reward-manager-handler';
|
|
11
|
+
import { PufferWithdrawalManagerHandler } from '../contracts/handlers/puffer-withdrawal-manager-handler';
|
|
12
|
+
/**
|
|
13
|
+
* The core class and the main entry point of the Puffer SDK.
|
|
14
|
+
*/
|
|
15
|
+
export declare class PufferClient {
|
|
16
|
+
private walletClient;
|
|
17
|
+
private publicClient;
|
|
18
|
+
/** Handler for the `ERC20Permit` contract. */
|
|
19
|
+
erc20Permit: ERC20PermitHandler;
|
|
20
|
+
/** Handler for the `PufferVaultV2` contract. */
|
|
21
|
+
vault: PufferVaultHandler;
|
|
22
|
+
/** Handler for the `PufferDepositor` contract. */
|
|
23
|
+
depositor: PufferDepositorHandler;
|
|
24
|
+
/** Handler for the `PufferL2Depositor` contract. */
|
|
25
|
+
l2Depositor: PufferL2DepositorHandler;
|
|
26
|
+
/** Handler for the `PufToken` contract. */
|
|
27
|
+
pufToken: PufTokenHandler;
|
|
28
|
+
/** Handler for the `PufLocker` contract. */
|
|
29
|
+
pufLocker: PufLockerHandler;
|
|
30
|
+
/** Handler for the `L2RewardManager` contract. */
|
|
31
|
+
l2RewardManager: L2RewardManagerHandler;
|
|
32
|
+
/** Handler for the `L1RewardManager` contract. */
|
|
33
|
+
l1RewardManager: L1RewardManagerHandler;
|
|
34
|
+
/** Handler for the `PufferWithdrawalManager` contract. */
|
|
35
|
+
pufferWithdrawalManager: PufferWithdrawalManagerHandler;
|
|
36
|
+
/**
|
|
37
|
+
* Create the Puffer Client.
|
|
38
|
+
*
|
|
39
|
+
* @param chain Chain to use for the client.
|
|
40
|
+
* @param walletClient The wallet client to use for wallet
|
|
41
|
+
* interactions.
|
|
42
|
+
* @param publicClient The public client to use for public
|
|
43
|
+
* interactions.
|
|
44
|
+
*/
|
|
45
|
+
constructor(chain: Chain, walletClient?: WalletClient, publicClient?: PublicClient);
|
|
46
|
+
/**
|
|
47
|
+
* Request addresses from the wallet.
|
|
48
|
+
*
|
|
49
|
+
* @returns An array of wallet addresses.
|
|
50
|
+
*/
|
|
51
|
+
requestAddresses(): Promise<import('viem').RequestAddressesReturnType>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
export declare const PufferDepositor: readonly [{
|
|
2
|
+
readonly type: "constructor";
|
|
3
|
+
readonly inputs: readonly [{
|
|
4
|
+
readonly name: "pufferVault";
|
|
5
|
+
readonly type: "address";
|
|
6
|
+
readonly internalType: "contract PufferVaultV2";
|
|
7
|
+
}, {
|
|
8
|
+
readonly name: "stETH";
|
|
9
|
+
readonly type: "address";
|
|
10
|
+
readonly internalType: "contract IStETH";
|
|
11
|
+
}];
|
|
12
|
+
readonly stateMutability: "payable";
|
|
13
|
+
}, {
|
|
14
|
+
readonly type: "function";
|
|
15
|
+
readonly name: "PUFFER_VAULT";
|
|
16
|
+
readonly inputs: readonly [];
|
|
17
|
+
readonly outputs: readonly [{
|
|
18
|
+
readonly name: "";
|
|
19
|
+
readonly type: "address";
|
|
20
|
+
readonly internalType: "contract PufferVaultV2";
|
|
21
|
+
}];
|
|
22
|
+
readonly stateMutability: "view";
|
|
23
|
+
}, {
|
|
24
|
+
readonly type: "function";
|
|
25
|
+
readonly name: "UPGRADE_INTERFACE_VERSION";
|
|
26
|
+
readonly inputs: readonly [];
|
|
27
|
+
readonly outputs: readonly [{
|
|
28
|
+
readonly name: "";
|
|
29
|
+
readonly type: "string";
|
|
30
|
+
readonly internalType: "string";
|
|
31
|
+
}];
|
|
32
|
+
readonly stateMutability: "view";
|
|
33
|
+
}, {
|
|
34
|
+
readonly type: "function";
|
|
35
|
+
readonly name: "authority";
|
|
36
|
+
readonly inputs: readonly [];
|
|
37
|
+
readonly outputs: readonly [{
|
|
38
|
+
readonly name: "";
|
|
39
|
+
readonly type: "address";
|
|
40
|
+
readonly internalType: "address";
|
|
41
|
+
}];
|
|
42
|
+
readonly stateMutability: "view";
|
|
43
|
+
}, {
|
|
44
|
+
readonly type: "function";
|
|
45
|
+
readonly name: "depositStETH";
|
|
46
|
+
readonly inputs: readonly [{
|
|
47
|
+
readonly name: "permitData";
|
|
48
|
+
readonly type: "tuple";
|
|
49
|
+
readonly internalType: "struct Permit";
|
|
50
|
+
readonly components: readonly [{
|
|
51
|
+
readonly name: "deadline";
|
|
52
|
+
readonly type: "uint256";
|
|
53
|
+
readonly internalType: "uint256";
|
|
54
|
+
}, {
|
|
55
|
+
readonly name: "amount";
|
|
56
|
+
readonly type: "uint256";
|
|
57
|
+
readonly internalType: "uint256";
|
|
58
|
+
}, {
|
|
59
|
+
readonly name: "v";
|
|
60
|
+
readonly type: "uint8";
|
|
61
|
+
readonly internalType: "uint8";
|
|
62
|
+
}, {
|
|
63
|
+
readonly name: "r";
|
|
64
|
+
readonly type: "bytes32";
|
|
65
|
+
readonly internalType: "bytes32";
|
|
66
|
+
}, {
|
|
67
|
+
readonly name: "s";
|
|
68
|
+
readonly type: "bytes32";
|
|
69
|
+
readonly internalType: "bytes32";
|
|
70
|
+
}];
|
|
71
|
+
}, {
|
|
72
|
+
readonly name: "recipient";
|
|
73
|
+
readonly type: "address";
|
|
74
|
+
readonly internalType: "address";
|
|
75
|
+
}];
|
|
76
|
+
readonly outputs: readonly [{
|
|
77
|
+
readonly name: "pufETHAmount";
|
|
78
|
+
readonly type: "uint256";
|
|
79
|
+
readonly internalType: "uint256";
|
|
80
|
+
}];
|
|
81
|
+
readonly stateMutability: "nonpayable";
|
|
82
|
+
}, {
|
|
83
|
+
readonly type: "function";
|
|
84
|
+
readonly name: "depositWstETH";
|
|
85
|
+
readonly inputs: readonly [{
|
|
86
|
+
readonly name: "permitData";
|
|
87
|
+
readonly type: "tuple";
|
|
88
|
+
readonly internalType: "struct Permit";
|
|
89
|
+
readonly components: readonly [{
|
|
90
|
+
readonly name: "deadline";
|
|
91
|
+
readonly type: "uint256";
|
|
92
|
+
readonly internalType: "uint256";
|
|
93
|
+
}, {
|
|
94
|
+
readonly name: "amount";
|
|
95
|
+
readonly type: "uint256";
|
|
96
|
+
readonly internalType: "uint256";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "v";
|
|
99
|
+
readonly type: "uint8";
|
|
100
|
+
readonly internalType: "uint8";
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "r";
|
|
103
|
+
readonly type: "bytes32";
|
|
104
|
+
readonly internalType: "bytes32";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "s";
|
|
107
|
+
readonly type: "bytes32";
|
|
108
|
+
readonly internalType: "bytes32";
|
|
109
|
+
}];
|
|
110
|
+
}, {
|
|
111
|
+
readonly name: "recipient";
|
|
112
|
+
readonly type: "address";
|
|
113
|
+
readonly internalType: "address";
|
|
114
|
+
}];
|
|
115
|
+
readonly outputs: readonly [{
|
|
116
|
+
readonly name: "pufETHAmount";
|
|
117
|
+
readonly type: "uint256";
|
|
118
|
+
readonly internalType: "uint256";
|
|
119
|
+
}];
|
|
120
|
+
readonly stateMutability: "nonpayable";
|
|
121
|
+
}, {
|
|
122
|
+
readonly type: "function";
|
|
123
|
+
readonly name: "isConsumingScheduledOp";
|
|
124
|
+
readonly inputs: readonly [];
|
|
125
|
+
readonly outputs: readonly [{
|
|
126
|
+
readonly name: "";
|
|
127
|
+
readonly type: "bytes4";
|
|
128
|
+
readonly internalType: "bytes4";
|
|
129
|
+
}];
|
|
130
|
+
readonly stateMutability: "view";
|
|
131
|
+
}, {
|
|
132
|
+
readonly type: "function";
|
|
133
|
+
readonly name: "proxiableUUID";
|
|
134
|
+
readonly inputs: readonly [];
|
|
135
|
+
readonly outputs: readonly [{
|
|
136
|
+
readonly name: "";
|
|
137
|
+
readonly type: "bytes32";
|
|
138
|
+
readonly internalType: "bytes32";
|
|
139
|
+
}];
|
|
140
|
+
readonly stateMutability: "view";
|
|
141
|
+
}, {
|
|
142
|
+
readonly type: "function";
|
|
143
|
+
readonly name: "setAuthority";
|
|
144
|
+
readonly inputs: readonly [{
|
|
145
|
+
readonly name: "newAuthority";
|
|
146
|
+
readonly type: "address";
|
|
147
|
+
readonly internalType: "address";
|
|
148
|
+
}];
|
|
149
|
+
readonly outputs: readonly [];
|
|
150
|
+
readonly stateMutability: "nonpayable";
|
|
151
|
+
}, {
|
|
152
|
+
readonly type: "function";
|
|
153
|
+
readonly name: "upgradeToAndCall";
|
|
154
|
+
readonly inputs: readonly [{
|
|
155
|
+
readonly name: "newImplementation";
|
|
156
|
+
readonly type: "address";
|
|
157
|
+
readonly internalType: "address";
|
|
158
|
+
}, {
|
|
159
|
+
readonly name: "data";
|
|
160
|
+
readonly type: "bytes";
|
|
161
|
+
readonly internalType: "bytes";
|
|
162
|
+
}];
|
|
163
|
+
readonly outputs: readonly [];
|
|
164
|
+
readonly stateMutability: "payable";
|
|
165
|
+
}, {
|
|
166
|
+
readonly type: "event";
|
|
167
|
+
readonly name: "AuthorityUpdated";
|
|
168
|
+
readonly inputs: readonly [{
|
|
169
|
+
readonly name: "authority";
|
|
170
|
+
readonly type: "address";
|
|
171
|
+
readonly indexed: false;
|
|
172
|
+
readonly internalType: "address";
|
|
173
|
+
}];
|
|
174
|
+
readonly anonymous: false;
|
|
175
|
+
}, {
|
|
176
|
+
readonly type: "event";
|
|
177
|
+
readonly name: "Initialized";
|
|
178
|
+
readonly inputs: readonly [{
|
|
179
|
+
readonly name: "version";
|
|
180
|
+
readonly type: "uint64";
|
|
181
|
+
readonly indexed: false;
|
|
182
|
+
readonly internalType: "uint64";
|
|
183
|
+
}];
|
|
184
|
+
readonly anonymous: false;
|
|
185
|
+
}, {
|
|
186
|
+
readonly type: "event";
|
|
187
|
+
readonly name: "Upgraded";
|
|
188
|
+
readonly inputs: readonly [{
|
|
189
|
+
readonly name: "implementation";
|
|
190
|
+
readonly type: "address";
|
|
191
|
+
readonly indexed: true;
|
|
192
|
+
readonly internalType: "address";
|
|
193
|
+
}];
|
|
194
|
+
readonly anonymous: false;
|
|
195
|
+
}, {
|
|
196
|
+
readonly type: "error";
|
|
197
|
+
readonly name: "AccessManagedInvalidAuthority";
|
|
198
|
+
readonly inputs: readonly [{
|
|
199
|
+
readonly name: "authority";
|
|
200
|
+
readonly type: "address";
|
|
201
|
+
readonly internalType: "address";
|
|
202
|
+
}];
|
|
203
|
+
}, {
|
|
204
|
+
readonly type: "error";
|
|
205
|
+
readonly name: "AccessManagedRequiredDelay";
|
|
206
|
+
readonly inputs: readonly [{
|
|
207
|
+
readonly name: "caller";
|
|
208
|
+
readonly type: "address";
|
|
209
|
+
readonly internalType: "address";
|
|
210
|
+
}, {
|
|
211
|
+
readonly name: "delay";
|
|
212
|
+
readonly type: "uint32";
|
|
213
|
+
readonly internalType: "uint32";
|
|
214
|
+
}];
|
|
215
|
+
}, {
|
|
216
|
+
readonly type: "error";
|
|
217
|
+
readonly name: "AccessManagedUnauthorized";
|
|
218
|
+
readonly inputs: readonly [{
|
|
219
|
+
readonly name: "caller";
|
|
220
|
+
readonly type: "address";
|
|
221
|
+
readonly internalType: "address";
|
|
222
|
+
}];
|
|
223
|
+
}, {
|
|
224
|
+
readonly type: "error";
|
|
225
|
+
readonly name: "AddressEmptyCode";
|
|
226
|
+
readonly inputs: readonly [{
|
|
227
|
+
readonly name: "target";
|
|
228
|
+
readonly type: "address";
|
|
229
|
+
readonly internalType: "address";
|
|
230
|
+
}];
|
|
231
|
+
}, {
|
|
232
|
+
readonly type: "error";
|
|
233
|
+
readonly name: "AddressInsufficientBalance";
|
|
234
|
+
readonly inputs: readonly [{
|
|
235
|
+
readonly name: "account";
|
|
236
|
+
readonly type: "address";
|
|
237
|
+
readonly internalType: "address";
|
|
238
|
+
}];
|
|
239
|
+
}, {
|
|
240
|
+
readonly type: "error";
|
|
241
|
+
readonly name: "ERC1967InvalidImplementation";
|
|
242
|
+
readonly inputs: readonly [{
|
|
243
|
+
readonly name: "implementation";
|
|
244
|
+
readonly type: "address";
|
|
245
|
+
readonly internalType: "address";
|
|
246
|
+
}];
|
|
247
|
+
}, {
|
|
248
|
+
readonly type: "error";
|
|
249
|
+
readonly name: "ERC1967NonPayable";
|
|
250
|
+
readonly inputs: readonly [];
|
|
251
|
+
}, {
|
|
252
|
+
readonly type: "error";
|
|
253
|
+
readonly name: "FailedInnerCall";
|
|
254
|
+
readonly inputs: readonly [];
|
|
255
|
+
}, {
|
|
256
|
+
readonly type: "error";
|
|
257
|
+
readonly name: "InvalidInitialization";
|
|
258
|
+
readonly inputs: readonly [];
|
|
259
|
+
}, {
|
|
260
|
+
readonly type: "error";
|
|
261
|
+
readonly name: "NotInitializing";
|
|
262
|
+
readonly inputs: readonly [];
|
|
263
|
+
}, {
|
|
264
|
+
readonly type: "error";
|
|
265
|
+
readonly name: "SafeERC20FailedOperation";
|
|
266
|
+
readonly inputs: readonly [{
|
|
267
|
+
readonly name: "token";
|
|
268
|
+
readonly type: "address";
|
|
269
|
+
readonly internalType: "address";
|
|
270
|
+
}];
|
|
271
|
+
}, {
|
|
272
|
+
readonly type: "error";
|
|
273
|
+
readonly name: "UUPSUnauthorizedCallContext";
|
|
274
|
+
readonly inputs: readonly [];
|
|
275
|
+
}, {
|
|
276
|
+
readonly type: "error";
|
|
277
|
+
readonly name: "UUPSUnsupportedProxiableUUID";
|
|
278
|
+
readonly inputs: readonly [{
|
|
279
|
+
readonly name: "slot";
|
|
280
|
+
readonly type: "bytes32";
|
|
281
|
+
readonly internalType: "bytes32";
|
|
282
|
+
}];
|
|
283
|
+
}];
|