@pufferfinance/puffer-sdk 1.12.2 → 1.13.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.
@@ -0,0 +1,318 @@
1
+ var o = Object.defineProperty;
2
+ var h = (i, t, e) => t in i ? o(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
3
+ var s = (i, t, e) => h(i, typeof t != "symbol" ? t + "" : t, e);
4
+ import { V as c } from "../../constants-BjRNQpT2.js";
5
+ import { CONTRACT_ADDRESSES as u } from "../addresses.js";
6
+ import { Distributor as C } from "../abis/mainnet/Distributor.js";
7
+ import { g as l } from "../../getContract-CezEyDf-.js";
8
+ class w {
9
+ /**
10
+ * Create the handler for the Distributor contract exposing
11
+ * methods to interact with the contract.
12
+ *
13
+ * @param chain Chain to use for the client.
14
+ * @param walletClient The wallet client to use for wallet interactions.
15
+ * @param publicClient The public client to use for public interactions.
16
+ */
17
+ constructor(t, e, r) {
18
+ s(this, "viemChain");
19
+ this.chain = t, this.walletClient = e, this.publicClient = r, this.viemChain = c[t];
20
+ }
21
+ /**
22
+ * Get the contract.
23
+ *
24
+ * @returns The viem contract.
25
+ */
26
+ getContract() {
27
+ const t = u[this.chain].Distributor, e = C, r = { public: this.publicClient, wallet: this.walletClient };
28
+ return l({ address: t, abi: e, client: r });
29
+ }
30
+ /**
31
+ * Check if an address can update the merkle root.
32
+ *
33
+ * @param address The address to check.
34
+ * @returns Whether the address can update the merkle root.
35
+ */
36
+ canUpdateMerkleRoot(t) {
37
+ return this.getContract().read.canUpdateMerkleRoot([t]);
38
+ }
39
+ /**
40
+ * Claim tokens for multiple users.
41
+ *
42
+ * @param account The account making the claim.
43
+ * @param params The claim parameters.
44
+ * @returns A promise that resolves to the transaction hash.
45
+ */
46
+ claim(t, { users: e, tokens: r, amounts: a, proofs: n }) {
47
+ return this.getContract().write.claim([e, r, a, n], {
48
+ account: t,
49
+ chain: this.viemChain
50
+ });
51
+ }
52
+ /**
53
+ * Get claim information for a user and token.
54
+ *
55
+ * @param user The user address.
56
+ * @param token The token address.
57
+ * @returns The claim information.
58
+ */
59
+ async claimed(t, e) {
60
+ const [r, a, n] = await this.getContract().read.claimed([t, e]);
61
+ return {
62
+ amount: r,
63
+ timestamp: BigInt(a),
64
+ merkleRoot: n
65
+ };
66
+ }
67
+ /**
68
+ * Get the core contract address.
69
+ *
70
+ * @returns The core contract address.
71
+ */
72
+ core() {
73
+ return this.getContract().read.core();
74
+ }
75
+ /**
76
+ * Get the dispute amount.
77
+ *
78
+ * @returns The dispute amount.
79
+ */
80
+ disputeAmount() {
81
+ return this.getContract().read.disputeAmount();
82
+ }
83
+ /**
84
+ * Get the dispute period.
85
+ *
86
+ * @returns The dispute period in seconds.
87
+ */
88
+ disputePeriod() {
89
+ return this.getContract().read.disputePeriod();
90
+ }
91
+ /**
92
+ * Get the dispute token address.
93
+ *
94
+ * @returns The dispute token address.
95
+ */
96
+ disputeToken() {
97
+ return this.getContract().read.disputeToken();
98
+ }
99
+ /**
100
+ * Dispute the current tree.
101
+ *
102
+ * @param account The account disputing the tree.
103
+ * @param reason The reason for the dispute.
104
+ * @returns A promise that resolves to the transaction hash.
105
+ */
106
+ disputeTree(t, e) {
107
+ return this.getContract().write.disputeTree([e], {
108
+ account: t,
109
+ chain: this.viemChain
110
+ });
111
+ }
112
+ /**
113
+ * Get the current disputer address.
114
+ *
115
+ * @returns The disputer address.
116
+ */
117
+ disputer() {
118
+ return this.getContract().read.disputer();
119
+ }
120
+ /**
121
+ * Get the end of the dispute period.
122
+ *
123
+ * @returns The timestamp when the dispute period ends.
124
+ */
125
+ endOfDisputePeriod() {
126
+ return this.getContract().read.endOfDisputePeriod();
127
+ }
128
+ /**
129
+ * Get the current merkle root.
130
+ *
131
+ * @returns The current merkle root.
132
+ */
133
+ getMerkleRoot() {
134
+ return this.getContract().read.getMerkleRoot();
135
+ }
136
+ /**
137
+ * Get the last tree information.
138
+ *
139
+ * @returns The last tree information.
140
+ */
141
+ async lastTree() {
142
+ const [t, e] = await this.getContract().read.lastTree();
143
+ return {
144
+ merkleRoot: t,
145
+ ipfsHash: e
146
+ };
147
+ }
148
+ /**
149
+ * Check if only operators can claim for a user.
150
+ *
151
+ * @param user The user address to check.
152
+ * @returns Whether only operators can claim for the user.
153
+ */
154
+ onlyOperatorCanClaim(t) {
155
+ return this.getContract().read.onlyOperatorCanClaim([t]);
156
+ }
157
+ /**
158
+ * Check if an address is an operator for a user.
159
+ *
160
+ * @param user The user address.
161
+ * @param operator The operator address.
162
+ * @returns Whether the address is an operator.
163
+ */
164
+ operators(t, e) {
165
+ return this.getContract().read.operators([t, e]);
166
+ }
167
+ /**
168
+ * Recover ERC20 tokens sent to the contract.
169
+ *
170
+ * @param account The account recovering the tokens.
171
+ * @param tokenAddress The token address to recover.
172
+ * @param to The address to send recovered tokens to.
173
+ * @param amountToRecover The amount to recover.
174
+ * @returns A promise that resolves to the transaction hash.
175
+ */
176
+ recoverERC20(t, e, r, a) {
177
+ return this.getContract().write.recoverERC20(
178
+ [e, r, a],
179
+ {
180
+ account: t,
181
+ chain: this.viemChain
182
+ }
183
+ );
184
+ }
185
+ /**
186
+ * Resolve a dispute.
187
+ *
188
+ * @param account The account resolving the dispute.
189
+ * @param valid Whether the disputed tree is valid.
190
+ * @returns A promise that resolves to the transaction hash.
191
+ */
192
+ resolveDispute(t, e) {
193
+ return this.getContract().write.resolveDispute([e], {
194
+ account: t,
195
+ chain: this.viemChain
196
+ });
197
+ }
198
+ /**
199
+ * Revoke the current tree.
200
+ *
201
+ * @param account The account revoking the tree.
202
+ * @returns A promise that resolves to the transaction hash.
203
+ */
204
+ revokeTree(t) {
205
+ return this.getContract().write.revokeTree({
206
+ account: t,
207
+ chain: this.viemChain
208
+ });
209
+ }
210
+ /**
211
+ * Set the dispute amount.
212
+ *
213
+ * @param account The account setting the dispute amount.
214
+ * @param disputeAmount The new dispute amount.
215
+ * @returns A promise that resolves to the transaction hash.
216
+ */
217
+ setDisputeAmount(t, e) {
218
+ return this.getContract().write.setDisputeAmount([e], {
219
+ account: t,
220
+ chain: this.viemChain
221
+ });
222
+ }
223
+ /**
224
+ * Set the dispute period.
225
+ *
226
+ * @param account The account setting the dispute period.
227
+ * @param disputePeriod The new dispute period in seconds.
228
+ * @returns A promise that resolves to the transaction hash.
229
+ */
230
+ setDisputePeriod(t, e) {
231
+ return this.getContract().write.setDisputePeriod([e], {
232
+ account: t,
233
+ chain: this.viemChain
234
+ });
235
+ }
236
+ /**
237
+ * Set the dispute token.
238
+ *
239
+ * @param account The account setting the dispute token.
240
+ * @param disputeToken The new dispute token address.
241
+ * @returns A promise that resolves to the transaction hash.
242
+ */
243
+ setDisputeToken(t, e) {
244
+ return this.getContract().write.setDisputeToken([e], {
245
+ account: t,
246
+ chain: this.viemChain
247
+ });
248
+ }
249
+ /**
250
+ * Toggle whether only operators can claim for a user.
251
+ *
252
+ * @param account The account toggling the setting.
253
+ * @param user The user address to toggle for.
254
+ * @returns A promise that resolves to the transaction hash.
255
+ */
256
+ toggleOnlyOperatorCanClaim(t, e) {
257
+ return this.getContract().write.toggleOnlyOperatorCanClaim([e], {
258
+ account: t,
259
+ chain: this.viemChain
260
+ });
261
+ }
262
+ /**
263
+ * Toggle an operator for a user.
264
+ *
265
+ * @param account The account toggling the operator.
266
+ * @param user The user address.
267
+ * @param operator The operator address to toggle.
268
+ * @returns A promise that resolves to the transaction hash.
269
+ */
270
+ toggleOperator(t, e, r) {
271
+ return this.getContract().write.toggleOperator([e, r], {
272
+ account: t,
273
+ chain: this.viemChain
274
+ });
275
+ }
276
+ /**
277
+ * Toggle whether an address is trusted.
278
+ *
279
+ * @param account The account toggling the trusted status.
280
+ * @param eoa The address to toggle trust for.
281
+ * @returns A promise that resolves to the transaction hash.
282
+ */
283
+ toggleTrusted(t, e) {
284
+ return this.getContract().write.toggleTrusted([e], {
285
+ account: t,
286
+ chain: this.viemChain
287
+ });
288
+ }
289
+ /**
290
+ * Get the current tree information.
291
+ *
292
+ * @returns The current tree information.
293
+ */
294
+ async tree() {
295
+ const [t, e] = await this.getContract().read.tree();
296
+ return {
297
+ merkleRoot: t,
298
+ ipfsHash: e
299
+ };
300
+ }
301
+ /**
302
+ * Update the merkle tree.
303
+ *
304
+ * @param account The account updating the tree.
305
+ * @param tree The new tree information.
306
+ * @returns A promise that resolves to the transaction hash.
307
+ */
308
+ updateTree(t, e) {
309
+ return this.getContract().write.updateTree([e], {
310
+ account: t,
311
+ chain: this.viemChain
312
+ });
313
+ }
314
+ }
315
+ export {
316
+ w as DistributorHandler
317
+ };
318
+ //# sourceMappingURL=distributor-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distributor-handler.js","sources":["../../../lib/contracts/handlers/distributor-handler.ts"],"sourcesContent":["import {\n WalletClient,\n PublicClient,\n getContract,\n Address,\n GetContractReturnType,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport { CONTRACT_ADDRESSES } from '../addresses';\nimport { Distributor } from '../abis/mainnet/Distributor';\n\ninterface ContractAddressesWithDistributor {\n Distributor: Address;\n}\n\nexport interface MerkleTree {\n merkleRoot: `0x${string}`;\n ipfsHash: `0x${string}`;\n}\n\nexport interface ClaimInfo {\n amount: bigint;\n timestamp: bigint;\n merkleRoot: `0x${string}`;\n}\n\nexport interface ClaimParams {\n users: Address[];\n tokens: Address[];\n amounts: bigint[];\n proofs: `0x${string}`[][];\n}\n\n/**\n * Handler for the Merkle Distributor contract, for claiming rewards, e.g. mtwCARROT.\n */\nexport class DistributorHandler {\n private viemChain: ViemChain;\n\n /**\n * Create the handler for the Distributor contract exposing\n * methods to interact with the contract.\n *\n * @param chain Chain to use for the client.\n * @param walletClient The wallet client to use for wallet interactions.\n * @param publicClient The public client to use for public interactions.\n */\n constructor(\n private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n }\n\n /**\n * Get the contract.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = (\n CONTRACT_ADDRESSES[\n this.chain\n ] as unknown as ContractAddressesWithDistributor\n ).Distributor;\n const abi = Distributor;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof abi,\n typeof client,\n Address\n >;\n }\n\n /**\n * Check if an address can update the merkle root.\n *\n * @param address The address to check.\n * @returns Whether the address can update the merkle root.\n */\n public canUpdateMerkleRoot(address: Address) {\n return this.getContract().read.canUpdateMerkleRoot([address]);\n }\n\n /**\n * Claim tokens for multiple users.\n *\n * @param account The account making the claim.\n * @param params The claim parameters.\n * @returns A promise that resolves to the transaction hash.\n */\n public claim(\n account: Address,\n { users, tokens, amounts, proofs }: ClaimParams,\n ) {\n return this.getContract().write.claim([users, tokens, amounts, proofs], {\n account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get claim information for a user and token.\n *\n * @param user The user address.\n * @param token The token address.\n * @returns The claim information.\n */\n public async claimed(user: Address, token: Address): Promise<ClaimInfo> {\n const [amount, timestamp, merkleRoot] =\n await this.getContract().read.claimed([user, token]);\n return {\n amount,\n timestamp: BigInt(timestamp),\n merkleRoot,\n };\n }\n\n /**\n * Get the core contract address.\n *\n * @returns The core contract address.\n */\n public core() {\n return this.getContract().read.core();\n }\n\n /**\n * Get the dispute amount.\n *\n * @returns The dispute amount.\n */\n public disputeAmount() {\n return this.getContract().read.disputeAmount();\n }\n\n /**\n * Get the dispute period.\n *\n * @returns The dispute period in seconds.\n */\n public disputePeriod() {\n return this.getContract().read.disputePeriod();\n }\n\n /**\n * Get the dispute token address.\n *\n * @returns The dispute token address.\n */\n public disputeToken() {\n return this.getContract().read.disputeToken();\n }\n\n /**\n * Dispute the current tree.\n *\n * @param account The account disputing the tree.\n * @param reason The reason for the dispute.\n * @returns A promise that resolves to the transaction hash.\n */\n public disputeTree(account: Address, reason: string) {\n return this.getContract().write.disputeTree([reason], {\n account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the current disputer address.\n *\n * @returns The disputer address.\n */\n public disputer() {\n return this.getContract().read.disputer();\n }\n\n /**\n * Get the end of the dispute period.\n *\n * @returns The timestamp when the dispute period ends.\n */\n public endOfDisputePeriod() {\n return this.getContract().read.endOfDisputePeriod();\n }\n\n /**\n * Get the current merkle root.\n *\n * @returns The current merkle root.\n */\n public getMerkleRoot() {\n return this.getContract().read.getMerkleRoot();\n }\n\n /**\n * Get the last tree information.\n *\n * @returns The last tree information.\n */\n public async lastTree(): Promise<MerkleTree> {\n const [merkleRoot, ipfsHash] = await this.getContract().read.lastTree();\n return {\n merkleRoot,\n ipfsHash,\n };\n }\n\n /**\n * Check if only operators can claim for a user.\n *\n * @param user The user address to check.\n * @returns Whether only operators can claim for the user.\n */\n public onlyOperatorCanClaim(user: Address) {\n return this.getContract().read.onlyOperatorCanClaim([user]);\n }\n\n /**\n * Check if an address is an operator for a user.\n *\n * @param user The user address.\n * @param operator The operator address.\n * @returns Whether the address is an operator.\n */\n public operators(user: Address, operator: Address) {\n return this.getContract().read.operators([user, operator]);\n }\n\n /**\n * Recover ERC20 tokens sent to the contract.\n *\n * @param account The account recovering the tokens.\n * @param tokenAddress The token address to recover.\n * @param to The address to send recovered tokens to.\n * @param amountToRecover The amount to recover.\n * @returns A promise that resolves to the transaction hash.\n */\n public recoverERC20(\n account: Address,\n tokenAddress: Address,\n to: Address,\n amountToRecover: bigint,\n ) {\n return this.getContract().write.recoverERC20(\n [tokenAddress, to, amountToRecover],\n {\n account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Resolve a dispute.\n *\n * @param account The account resolving the dispute.\n * @param valid Whether the disputed tree is valid.\n * @returns A promise that resolves to the transaction hash.\n */\n public resolveDispute(account: Address, valid: boolean) {\n return this.getContract().write.resolveDispute([valid], {\n account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Revoke the current tree.\n *\n * @param account The account revoking the tree.\n * @returns A promise that resolves to the transaction hash.\n */\n public revokeTree(account: Address) {\n return this.getContract().write.revokeTree({\n account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Set the dispute amount.\n *\n * @param account The account setting the dispute amount.\n * @param disputeAmount The new dispute amount.\n * @returns A promise that resolves to the transaction hash.\n */\n public setDisputeAmount(account: Address, disputeAmount: bigint) {\n return this.getContract().write.setDisputeAmount([disputeAmount], {\n account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Set the dispute period.\n *\n * @param account The account setting the dispute period.\n * @param disputePeriod The new dispute period in seconds.\n * @returns A promise that resolves to the transaction hash.\n */\n public setDisputePeriod(account: Address, disputePeriod: number) {\n return this.getContract().write.setDisputePeriod([disputePeriod], {\n account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Set the dispute token.\n *\n * @param account The account setting the dispute token.\n * @param disputeToken The new dispute token address.\n * @returns A promise that resolves to the transaction hash.\n */\n public setDisputeToken(account: Address, disputeToken: Address) {\n return this.getContract().write.setDisputeToken([disputeToken], {\n account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Toggle whether only operators can claim for a user.\n *\n * @param account The account toggling the setting.\n * @param user The user address to toggle for.\n * @returns A promise that resolves to the transaction hash.\n */\n public toggleOnlyOperatorCanClaim(account: Address, user: Address) {\n return this.getContract().write.toggleOnlyOperatorCanClaim([user], {\n account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Toggle an operator for a user.\n *\n * @param account The account toggling the operator.\n * @param user The user address.\n * @param operator The operator address to toggle.\n * @returns A promise that resolves to the transaction hash.\n */\n public toggleOperator(account: Address, user: Address, operator: Address) {\n return this.getContract().write.toggleOperator([user, operator], {\n account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Toggle whether an address is trusted.\n *\n * @param account The account toggling the trusted status.\n * @param eoa The address to toggle trust for.\n * @returns A promise that resolves to the transaction hash.\n */\n public toggleTrusted(account: Address, eoa: Address) {\n return this.getContract().write.toggleTrusted([eoa], {\n account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the current tree information.\n *\n * @returns The current tree information.\n */\n public async tree(): Promise<MerkleTree> {\n const [merkleRoot, ipfsHash] = await this.getContract().read.tree();\n return {\n merkleRoot,\n ipfsHash,\n };\n }\n\n /**\n * Update the merkle tree.\n *\n * @param account The account updating the tree.\n * @param tree The new tree information.\n * @returns A promise that resolves to the transaction hash.\n */\n public updateTree(account: Address, tree: MerkleTree) {\n return this.getContract().write.updateTree([tree], {\n account,\n chain: this.viemChain,\n });\n }\n}\n"],"names":["DistributorHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","address","CONTRACT_ADDRESSES","abi","Distributor","client","getContract","account","users","tokens","amounts","proofs","user","token","amount","timestamp","merkleRoot","reason","ipfsHash","operator","tokenAddress","to","amountToRecover","valid","disputeAmount","disputePeriod","disputeToken","eoa","tree"],"mappings":";;;;;;;AAoCO,MAAMA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAW9B,YACUC,GACAC,GACAC,GACR;AAdM,IAAAC,EAAA;AAWE,SAAA,QAAAH,GACA,KAAA,eAAAC,GACA,KAAA,eAAAC,GAEH,KAAA,YAAYE,EAAYJ,CAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7B,cAAc;AACnB,UAAMK,IACJC,EACE,KAAK,KACP,EACA,aACIC,IAAMC,GACNC,IAAS,EAAE,QAAQ,KAAK,cAAc,QAAQ,KAAK,aAAa;AAEtE,WAAOC,EAAY,EAAE,SAAAL,GAAS,KAAAE,GAAK,QAAAE,GAAQ;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAatC,oBAAoBJ,GAAkB;AAC3C,WAAO,KAAK,YAAY,EAAE,KAAK,oBAAoB,CAACA,CAAO,CAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUvD,MACLM,GACA,EAAE,OAAAC,GAAO,QAAAC,GAAQ,SAAAC,GAAS,QAAAC,KAC1B;AACO,WAAA,KAAK,YAAY,E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AAApB;AAAA,MACA,OAAO,KAAK;AAAA,IAAA,CACb;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQH,MAAa,OAA4B;AACjC,UAAA,CAACS,GAAYE,CAAQ,IAAI,MAAM,KAAK,YAAc,EAAA,KAAK,KAAK;AAC3D,WAAA;AAAA,MACL,YAAAF;AAAA,MACA,UAAAE;AAAA,IACF;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUK,WAAWX,GAAkBqB,GAAkB;AACpD,WAAO,KAAK,YAAY,EAAE,MAAM,WAAW,CAACA,CAAI,GAAG;AAAA,MACjD,SAAArB;AAAA,MACA,OAAO,KAAK;AAAA,IAAA,CACb;AAAA,EAAA;AAEL;"}
package/dist/main.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./api/puffer-client.cjs"),n=require("./api/puffer-client-helpers.cjs"),r=require("./constants-DA2xUb9r.cjs"),e=require("./contracts/tokens.cjs"),t=require("./contracts/addresses.cjs"),l=require("./contracts/handlers/erc20-permit-handler.cjs"),s=require("./contracts/handlers/l1-reward-manager-handler.cjs"),o=require("./contracts/handlers/l2-reward-manager-handler.cjs"),d=require("./contracts/handlers/puf-locker-handler.cjs"),i=require("./contracts/handlers/puffer-depositor-handler.cjs"),f=require("./contracts/handlers/puffer-l2-depositor-handler.cjs"),c=require("./contracts/handlers/puffer-vault-handler.cjs"),u=require("./contracts/handlers/puffer-withdrawal-manager-handler.cjs");exports.PufferClient=a.PufferClient;exports.PufferClientHelpers=n.PufferClientHelpers;exports.Chain=r.Chain;exports.VIEM_CHAINS=r.VIEM_CHAINS;exports.TOKENS_ADDRESSES=e.TOKENS_ADDRESSES;exports.TOKENS_PERMIT_VERSION=e.TOKENS_PERMIT_VERSION;exports.TOKENS_SALT=e.TOKENS_SALT;exports.Token=e.Token;exports.UnifiToken=e.UnifiToken;exports.CONTRACT_ADDRESSES=t.CONTRACT_ADDRESSES;exports.ERC20PermitHandler=l.ERC20PermitHandler;exports.L1RewardManagerHandler=s.L1RewardManagerHandler;exports.L2RewardManagerHandler=o.L2RewardManagerHandler;exports.PufLockerHandler=d.PufLockerHandler;exports.PufferDepositorHandler=i.PufferDepositorHandler;exports.PufferL2DepositorHandler=f.PufferL2DepositorHandler;exports.PufferVaultHandler=c.PufferVaultHandler;exports.PufferWithdrawalManagerHandler=u.PufferWithdrawalManagerHandler;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./api/puffer-client.cjs"),a=require("./api/puffer-client-helpers.cjs"),e=require("./constants-DA2xUb9r.cjs"),r=require("./contracts/tokens.cjs"),t=require("./contracts/addresses.cjs"),l=require("./contracts/handlers/erc20-permit-handler.cjs"),s=require("./contracts/handlers/l1-reward-manager-handler.cjs"),o=require("./contracts/handlers/l2-reward-manager-handler.cjs"),d=require("./contracts/handlers/puf-locker-handler.cjs"),i=require("./contracts/handlers/puffer-depositor-handler.cjs"),c=require("./contracts/handlers/puffer-l2-depositor-handler.cjs"),u=require("./contracts/handlers/puffer-vault-handler.cjs"),f=require("./contracts/handlers/puffer-withdrawal-manager-handler.cjs"),_=require("./contracts/handlers/distributor-handler.cjs");exports.PufferClient=n.PufferClient;exports.PufferClientHelpers=a.PufferClientHelpers;exports.Chain=e.Chain;exports.VIEM_CHAINS=e.VIEM_CHAINS;exports.TOKENS_ADDRESSES=r.TOKENS_ADDRESSES;exports.TOKENS_PERMIT_VERSION=r.TOKENS_PERMIT_VERSION;exports.TOKENS_SALT=r.TOKENS_SALT;exports.Token=r.Token;exports.UnifiToken=r.UnifiToken;exports.CONTRACT_ADDRESSES=t.CONTRACT_ADDRESSES;exports.ERC20PermitHandler=l.ERC20PermitHandler;exports.L1RewardManagerHandler=s.L1RewardManagerHandler;exports.L2RewardManagerHandler=o.L2RewardManagerHandler;exports.PufLockerHandler=d.PufLockerHandler;exports.PufferDepositorHandler=i.PufferDepositorHandler;exports.PufferL2DepositorHandler=c.PufferL2DepositorHandler;exports.PufferVaultHandler=u.PufferVaultHandler;exports.PufferWithdrawalManagerHandler=f.PufferWithdrawalManagerHandler;exports.DistributorHandler=_.DistributorHandler;
2
2
  //# sourceMappingURL=main.cjs.map
package/dist/main.d.ts CHANGED
@@ -11,3 +11,4 @@ export * from './contracts/handlers/puffer-depositor-handler';
11
11
  export * from './contracts/handlers/puffer-l2-depositor-handler';
12
12
  export * from './contracts/handlers/puffer-vault-handler';
13
13
  export * from './contracts/handlers/puffer-withdrawal-manager-handler';
14
+ export * from './contracts/handlers/distributor-handler';
package/dist/main.js CHANGED
@@ -1,23 +1,25 @@
1
1
  import { PufferClient as o } from "./api/puffer-client.js";
2
2
  import { PufferClientHelpers as a } from "./api/puffer-client-helpers.js";
3
3
  import { C as n, V as p } from "./constants-BjRNQpT2.js";
4
- import { TOKENS_ADDRESSES as l, TOKENS_PERMIT_VERSION as x, TOKENS_SALT as S, Token as d, UnifiToken as E } from "./contracts/tokens.js";
5
- import { CONTRACT_ADDRESSES as i } from "./contracts/addresses.js";
6
- import { ERC20PermitHandler as T } from "./contracts/handlers/erc20-permit-handler.js";
4
+ import { TOKENS_ADDRESSES as l, TOKENS_PERMIT_VERSION as x, TOKENS_SALT as d, Token as S, UnifiToken as i } from "./contracts/tokens.js";
5
+ import { CONTRACT_ADDRESSES as H } from "./contracts/addresses.js";
6
+ import { ERC20PermitHandler as P } from "./contracts/handlers/erc20-permit-handler.js";
7
7
  import { L1RewardManagerHandler as C } from "./contracts/handlers/l1-reward-manager-handler.js";
8
8
  import { L2RewardManagerHandler as D } from "./contracts/handlers/l2-reward-manager-handler.js";
9
- import { PufLockerHandler as _ } from "./contracts/handlers/puf-locker-handler.js";
9
+ import { PufLockerHandler as N } from "./contracts/handlers/puf-locker-handler.js";
10
10
  import { PufferDepositorHandler as A } from "./contracts/handlers/puffer-depositor-handler.js";
11
11
  import { PufferL2DepositorHandler as M } from "./contracts/handlers/puffer-l2-depositor-handler.js";
12
12
  import { PufferVaultHandler as I } from "./contracts/handlers/puffer-vault-handler.js";
13
13
  import { PufferWithdrawalManagerHandler as g } from "./contracts/handlers/puffer-withdrawal-manager-handler.js";
14
+ import { DistributorHandler as w } from "./contracts/handlers/distributor-handler.js";
14
15
  export {
15
- i as CONTRACT_ADDRESSES,
16
+ H as CONTRACT_ADDRESSES,
16
17
  n as Chain,
17
- T as ERC20PermitHandler,
18
+ w as DistributorHandler,
19
+ P as ERC20PermitHandler,
18
20
  C as L1RewardManagerHandler,
19
21
  D as L2RewardManagerHandler,
20
- _ as PufLockerHandler,
22
+ N as PufLockerHandler,
21
23
  o as PufferClient,
22
24
  a as PufferClientHelpers,
23
25
  A as PufferDepositorHandler,
@@ -26,9 +28,9 @@ export {
26
28
  g as PufferWithdrawalManagerHandler,
27
29
  l as TOKENS_ADDRESSES,
28
30
  x as TOKENS_PERMIT_VERSION,
29
- S as TOKENS_SALT,
30
- d as Token,
31
- E as UnifiToken,
31
+ d as TOKENS_SALT,
32
+ S as Token,
33
+ i as UnifiToken,
32
34
  p as VIEM_CHAINS
33
35
  };
34
36
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
1
+ {"version":3,"file":"main.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="1.12.1",o=e;exports.version=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="1.12.2",o=e;exports.version=o;
2
2
  //# sourceMappingURL=version.cjs.map
@@ -1,4 +1,4 @@
1
- const o = "1.12.1", n = o;
1
+ const o = "1.12.2", n = o;
2
2
  export {
3
3
  n as version
4
4
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pufferfinance/puffer-sdk",
3
3
  "description": "SDK for interacting with the puffer smart contracts",
4
- "version": "1.12.2",
4
+ "version": "1.13.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/PufferFinance/puffer-sdk.git"