@pufferfinance/puffer-sdk 1.26.0 → 1.26.2

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 (30) hide show
  1. package/dist/contracts/abis/mainnet/PufferVaultV5.cjs +2 -0
  2. package/dist/contracts/abis/mainnet/PufferVaultV5.cjs.map +1 -0
  3. package/dist/contracts/abis/mainnet/PufferVaultV5.d.ts +812 -0
  4. package/dist/contracts/abis/mainnet/PufferVaultV5.js +507 -0
  5. package/dist/contracts/abis/mainnet/PufferVaultV5.js.map +1 -0
  6. package/dist/contracts/handlers/erc20-permit-handler.cjs +1 -1
  7. package/dist/contracts/handlers/erc20-permit-handler.cjs.map +1 -1
  8. package/dist/contracts/handlers/erc20-permit-handler.d.ts +7 -0
  9. package/dist/contracts/handlers/erc20-permit-handler.js +10 -1
  10. package/dist/contracts/handlers/erc20-permit-handler.js.map +1 -1
  11. package/dist/contracts/handlers/puffer-vault-handler.cjs +1 -1
  12. package/dist/contracts/handlers/puffer-vault-handler.cjs.map +1 -1
  13. package/dist/contracts/handlers/puffer-vault-handler.d.ts +710 -69
  14. package/dist/contracts/handlers/puffer-vault-handler.js +38 -22
  15. package/dist/contracts/handlers/puffer-vault-handler.js.map +1 -1
  16. package/dist/contracts/handlers/vl-puffer-handler.cjs +1 -1
  17. package/dist/contracts/handlers/vl-puffer-handler.cjs.map +1 -1
  18. package/dist/contracts/handlers/vl-puffer-handler.d.ts +16 -7
  19. package/dist/contracts/handlers/vl-puffer-handler.js +48 -30
  20. package/dist/contracts/handlers/vl-puffer-handler.js.map +1 -1
  21. package/dist/contracts/tokens.cjs +1 -1
  22. package/dist/contracts/tokens.cjs.map +1 -1
  23. package/dist/contracts/tokens.js +2 -0
  24. package/dist/contracts/tokens.js.map +1 -1
  25. package/dist/contracts/vaults-addresses.cjs.map +1 -1
  26. package/dist/contracts/vaults-addresses.js +1 -0
  27. package/dist/contracts/vaults-addresses.js.map +1 -1
  28. package/dist/utils/version.cjs +1 -1
  29. package/dist/utils/version.js +1 -1
  30. package/package.json +1 -1
@@ -1,11 +1,11 @@
1
1
  var r = Object.defineProperty;
2
- var o = (e, t, a) => t in e ? r(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
3
- var c = (e, t, a) => o(e, typeof t != "symbol" ? t + "" : t, a);
2
+ var o = (i, t, a) => t in i ? r(i, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : i[t] = a;
3
+ var s = (i, t, a) => o(i, typeof t != "symbol" ? t + "" : t, a);
4
4
  import { V as h } from "../../constants-C9YZ6Ewc.js";
5
5
  import { CONTRACT_ADDRESSES as m } from "../addresses.js";
6
- import { PufferVaultV2 as C } from "../abis/mainnet/PufferVaultV2.js";
7
- import { g as u } from "../../getContract-DEPNMZxg.js";
8
- class l {
6
+ import { PufferVaultV5 as u } from "../abis/mainnet/PufferVaultV5.js";
7
+ import { g as C } from "../../getContract-DEPNMZxg.js";
8
+ class E {
9
9
  /**
10
10
  * Create the handler for the `PufferVaultV2` contract exposing
11
11
  * methods to interact with the contract.
@@ -16,9 +16,9 @@ class l {
16
16
  * @param publicClient The public client to use for public
17
17
  * interactions.
18
18
  */
19
- constructor(t, a, i) {
20
- c(this, "viemChain");
21
- this.chain = t, this.walletClient = a, this.publicClient = i, this.viemChain = h[t];
19
+ constructor(t, a, e) {
20
+ s(this, "viemChain");
21
+ this.chain = t, this.walletClient = a, this.publicClient = e, this.viemChain = h[t];
22
22
  }
23
23
  /**
24
24
  * Get the contract. This is a method because the typings are complex
@@ -27,8 +27,8 @@ class l {
27
27
  * @returns The viem contract.
28
28
  */
29
29
  getContract() {
30
- const t = m[this.chain].PufferVault, a = C, i = { public: this.publicClient, wallet: this.walletClient };
31
- return u({ address: t, abi: a, client: i });
30
+ const t = m[this.chain].PufferVault, a = u, e = { public: this.publicClient, wallet: this.walletClient };
31
+ return C({ address: t, abi: a, client: e });
32
32
  }
33
33
  /**
34
34
  * Deposit tokens(e.g. WETH) in exchange for pufETH. This doesn't make the
@@ -116,15 +116,15 @@ class l {
116
116
  * `estimate: () => Promise<bigint>` - Gas estimate of the
117
117
  * transaction.
118
118
  */
119
- withdraw(t, a, i) {
119
+ withdraw(t, a, e) {
120
120
  return { transact: async () => await this.getContract().write.withdraw(
121
- [i, a, t],
121
+ [e, a, t],
122
122
  {
123
123
  account: a,
124
124
  chain: this.viemChain
125
125
  }
126
126
  ), estimate: async () => await this.getContract().estimateGas.withdraw(
127
- [i, a, t],
127
+ [e, a, t],
128
128
  {
129
129
  account: a
130
130
  }
@@ -154,7 +154,8 @@ class l {
154
154
  * Returns how many basis points of a fee there are when exiting. For
155
155
  * example, a 1% fee would mean 1% of the user's requested pufETH is
156
156
  * burned (which increases the value for all pufETH holders) before
157
- * the ETH is redeemed. i.e., you get 1% less ETH back.
157
+ * the ETH is redeemed. i.e., you get 1% less ETH back. i.e., you get
158
+ * 1% less ETH back.
158
159
  *
159
160
  * @returns Basis points of the exit fee.
160
161
  */
@@ -162,12 +163,27 @@ class l {
162
163
  return this.getContract().read.getExitFeeBasisPoints();
163
164
  }
164
165
  /**
165
- * Returns how much WETH can still be withdrawn today.
166
+ * Returns how many treasury basis points of a fee there are when
167
+ * exiting. For example, a 1% fee would mean 1% of the user's
168
+ * requested pufETH is burned (which increases the value for all
169
+ * pufETH holders) before the ETH is redeemed.
166
170
  *
167
- * @returns Remaining WETH daily withdrawal limit.
171
+ * @returns Basis points of the exit fee.
172
+ */
173
+ getTreasuryExitFeeBasisPoints() {
174
+ return this.getContract().read.getTreasuryExitFeeBasisPoints();
175
+ }
176
+ /**
177
+ * Returns how many basis points of a fee there are in total when
178
+ * exiting. For example, a 1% fee would mean 1% of the user's
179
+ * requested pufETH is burned (which increases the value for all
180
+ * pufETH holders) before the ETH is redeemed. i.e., you get 1% less
181
+ * ETH back.
182
+ *
183
+ * @returns Basis points of the exit fee.
168
184
  */
169
- getRemainingAssetsDailyWithdrawalLimit() {
170
- return this.getContract().read.getRemainingAssetsDailyWithdrawalLimit();
185
+ getTotalExitFeeBasisPoints() {
186
+ return this.getContract().read.getTotalExitFeeBasisPoints();
171
187
  }
172
188
  /**
173
189
  * Redeems pufETH shares in exchange for WETH assets from the vault.
@@ -184,15 +200,15 @@ class l {
184
200
  * `estimate: () => Promise<bigint>` - Gas estimate of the
185
201
  * transaction.
186
202
  */
187
- redeem(t, a, i) {
203
+ redeem(t, a, e) {
188
204
  return { transact: async () => await this.getContract().write.redeem(
189
- [i, a, t],
205
+ [e, a, t],
190
206
  {
191
207
  account: t,
192
208
  chain: this.viemChain
193
209
  }
194
210
  ), estimate: async () => await this.getContract().estimateGas.redeem(
195
- [i, a, t],
211
+ [e, a, t],
196
212
  {
197
213
  account: t
198
214
  }
@@ -210,6 +226,6 @@ class l {
210
226
  }
211
227
  }
212
228
  export {
213
- l as PufferVaultHandler
229
+ E as PufferVaultHandler
214
230
  };
215
231
  //# sourceMappingURL=puffer-vault-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"puffer-vault-handler.js","sources":["../../../lib/contracts/handlers/puffer-vault-handler.ts"],"sourcesContent":["import {\n Address,\n GetContractReturnType,\n PublicClient,\n WalletClient,\n getContract,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport { CONTRACT_ADDRESSES } from '../addresses';\nimport { PufferVaultV2 } from '../abis/mainnet/PufferVaultV2';\n\n/**\n * Handler for the `PufferVaultV2` contract exposing methods to interact\n * with the contract.\n */\nexport class PufferVaultHandler {\n private viemChain: ViemChain;\n\n /**\n * Create the handler for the `PufferVaultV2` 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\n * interactions.\n * @param publicClient The public client to use for public\n * 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. This is a method because the typings are complex\n * and lost when trying to make it a member.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = CONTRACT_ADDRESSES[this.chain].PufferVault as Address;\n const abi = PufferVaultV2;\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 * Deposit tokens(e.g. WETH) in exchange for pufETH. This doesn't make the\n * transaction but returns two methods namely `transact` and\n * `estimate`.\n *\n * @param walletAddress Wallet address to get the tokens from.\n * @param value Value of tokens to deposit.\n * @returns `transact: (value: bigint) => Promise<Address>` -\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public deposit(walletAddress: Address, value: bigint) {\n const transact = async () =>\n await this.getContract().write.deposit([value, walletAddress], {\n account: walletAddress,\n chain: this.viemChain,\n });\n\n const estimate = async () =>\n await this.getContract().estimateGas.deposit([value, walletAddress], {\n account: walletAddress,\n });\n\n return { transact, estimate };\n }\n\n /**\n * Deposit ETH in exchange for pufETH. This doesn't make the\n * transaction but returns two methods namely `transact` and\n * `estimate`.\n *\n * @param walletAddress Wallet address to get the ETH from.\n * @returns `transact: (value: bigint) => Promise<Address>` - Used to\n * make the transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public depositETH(walletAddress: Address) {\n const transact = async (value: bigint) =>\n await this.getContract().write.depositETH([walletAddress], {\n account: walletAddress,\n chain: this.viemChain,\n value,\n });\n\n const estimate = async () =>\n await this.getContract().estimateGas.depositETH([walletAddress], {\n account: walletAddress,\n });\n\n return { transact, estimate };\n }\n\n /**\n * Check the pufETH balance of the wallet.\n *\n * @param walletAddress Wallet address to check the balance of.\n * @returns pufETH balance in wei.\n */\n public async balanceOf(walletAddress: Address) {\n return await this.getContract().read.balanceOf([walletAddress]);\n }\n\n /**\n * Get the rate of pufETH compared to ETH.\n *\n * @returns Rate of pufETH compared to 1 ETH.\n */\n public async getPufETHRate() {\n const oneWei = BigInt(1e18);\n return await this.getContract().read.previewDeposit([oneWei]);\n }\n\n /**\n * Get the allowance for the given owner and spender.\n *\n * @param ownerAddress Address of the owner.\n * @param spenderAddress Address of the spender.\n * @returns Allowance for the given owner and spender.\n */\n public async getAllowance(ownerAddress: Address, spenderAddress: Address) {\n return await this.getContract().read.allowance([\n ownerAddress,\n spenderAddress,\n ]);\n }\n\n /**\n * Withdraw pufETH to the given wallet address. This doesn't make the\n * transaction but returns two methods namely `transact` and\n * `estimate`.\n *\n * @param ownerAddress Address of the owner.\n * @param walletAddress Address of the receiver.\n * @param value Value of pufETH to withdraw.\n * @returns `transact: (value: bigint) => Promise<Address>` - Used to\n * make the transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public withdraw(\n ownerAddress: Address,\n walletAddress: Address,\n value: bigint,\n ) {\n const transact = async () =>\n await this.getContract().write.withdraw(\n [value, walletAddress, ownerAddress],\n {\n account: walletAddress,\n chain: this.viemChain,\n },\n );\n\n const estimate = async () =>\n await this.getContract().estimateGas.withdraw(\n [value, walletAddress, ownerAddress],\n {\n account: walletAddress,\n },\n );\n\n return { transact, estimate };\n }\n\n /**\n * Preview the amount of WETH that can be redeemed for the given\n * amount of pufETH using the `.redeem()` method.\n *\n * @param value Value of pufETH to redeem.\n * @returns Preview of the amount of WETH that can be redeemed.\n */\n public previewRedeem(value: bigint) {\n return this.getContract().read.previewRedeem([value]);\n }\n\n /**\n * Calculates the maximum amount of pufETH shares that can be redeemed\n * by the owner.\n *\n * @param ownerAddress Address of the owner's wallet.\n * @returns Maximum amount of pufETH shares that can be redeemed.\n */\n public maxRedeem(ownerAddress: Address) {\n return this.getContract().read.maxRedeem([ownerAddress]);\n }\n\n /**\n * Returns how many basis points of a fee there are when exiting. For\n * example, a 1% fee would mean 1% of the user's requested pufETH is\n * burned (which increases the value for all pufETH holders) before\n * the ETH is redeemed. i.e., you get 1% less ETH back.\n *\n * @returns Basis points of the exit fee.\n */\n public getExitFeeBasisPoints() {\n return this.getContract().read.getExitFeeBasisPoints();\n }\n\n /**\n * Returns how much WETH can still be withdrawn today.\n *\n * @returns Remaining WETH daily withdrawal limit.\n */\n public getRemainingAssetsDailyWithdrawalLimit() {\n return this.getContract().read.getRemainingAssetsDailyWithdrawalLimit();\n }\n\n /**\n * Redeems pufETH shares in exchange for WETH assets from the vault.\n * In the process, the pufETH shares of the owner are burned. This\n * doesn't make the transaction but returns two methods namely\n * `transact` and `estimate`.\n *\n * @param ownerAddress Address of the owner of pufETH.\n * @param receiverAddress Address of the receiver of WETH.\n * @param shares Amount of pufETH shares to redeem.\n * @returns `transact: (value: bigint) => Promise<Address>` - Used to\n * make the transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public redeem(\n ownerAddress: Address,\n receiverAddress: Address,\n shares: bigint,\n ) {\n const transact = async () =>\n await this.getContract().write.redeem(\n [shares, receiverAddress, ownerAddress],\n {\n account: ownerAddress,\n chain: this.viemChain,\n },\n );\n\n const estimate = async () =>\n await this.getContract().estimateGas.redeem(\n [shares, receiverAddress, ownerAddress],\n {\n account: ownerAddress,\n },\n );\n\n return { transact, estimate };\n }\n\n /**\n * Gives exchange rate of pufETH relative to WETH.\n * This does not include any fees, as compared to previewRedeem method.\n *\n * @param amount Amount of pufETH to convert.\n * @returns Amount of equivalent WETH.\n */\n public convertToAssets(amount: bigint) {\n return this.getContract().read.convertToAssets([amount]);\n }\n}\n"],"names":["PufferVaultHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","address","CONTRACT_ADDRESSES","abi","PufferVaultV2","client","getContract","walletAddress","value","oneWei","ownerAddress","spenderAddress","receiverAddress","shares","amount"],"mappings":";;;;;;;AAeO,MAAMA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAa9B,YACUC,GACAC,GACAC,GACR;AAhBM,IAAAC,EAAA;AAaE,SAAA,QAAAH,GACA,KAAA,eAAAC,GACA,K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AAA;AAAA,EAQhD,yCAAyC;AAC9C,WAAO,KAAK,cAAc,KAAK,uCAAuC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAkBjE,OACLA,GACAE,GACAC,GACA;AAkBO,WAAA,EAAE,UAjBQ,YACf,MAAM,KAAK,cAAc,MAAM;AAAA,MAC7B,CAACA,GAAQD,GAAiBF,CAAY;AAAA,MACtC;AAAA,QACE,SAASA;AAAA,QACT,OAAO,KAAK;AAAA,MAAA;AAAA,IAEhB,GAUiB,UARF,YACf,MAAM,KAAK,cAAc,YAAY;AAAA,MACnC,CAACG,GAAQD,GAAiBF,CAAY;AAAA,MACtC;AAAA,QACE,SAASA;AAAA,MAAA;AAAA,IAEb,EAE0B;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUvB,gBAAgBI,GAAgB;AACrC,WAAO,KAAK,YAAY,EAAE,KAAK,gBAAgB,CAACA,CAAM,CAAC;AAAA,EAAA;AAE3D;"}
1
+ {"version":3,"file":"puffer-vault-handler.js","sources":["../../../lib/contracts/handlers/puffer-vault-handler.ts"],"sourcesContent":["import {\n Address,\n GetContractReturnType,\n PublicClient,\n WalletClient,\n getContract,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport { CONTRACT_ADDRESSES } from '../addresses';\nimport { PufferVaultV5 } from '../abis/mainnet/PufferVaultV5';\n\n/**\n * Handler for the `PufferVaultV2` contract exposing methods to interact\n * with the contract.\n */\nexport class PufferVaultHandler {\n private viemChain: ViemChain;\n\n /**\n * Create the handler for the `PufferVaultV2` 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\n * interactions.\n * @param publicClient The public client to use for public\n * 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. This is a method because the typings are complex\n * and lost when trying to make it a member.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = CONTRACT_ADDRESSES[this.chain].PufferVault as Address;\n const abi = PufferVaultV5;\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 * Deposit tokens(e.g. WETH) in exchange for pufETH. This doesn't make the\n * transaction but returns two methods namely `transact` and\n * `estimate`.\n *\n * @param walletAddress Wallet address to get the tokens from.\n * @param value Value of tokens to deposit.\n * @returns `transact: (value: bigint) => Promise<Address>` -\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public deposit(walletAddress: Address, value: bigint) {\n const transact = async () =>\n await this.getContract().write.deposit([value, walletAddress], {\n account: walletAddress,\n chain: this.viemChain,\n });\n\n const estimate = async () =>\n await this.getContract().estimateGas.deposit([value, walletAddress], {\n account: walletAddress,\n });\n\n return { transact, estimate };\n }\n\n /**\n * Deposit ETH in exchange for pufETH. This doesn't make the\n * transaction but returns two methods namely `transact` and\n * `estimate`.\n *\n * @param walletAddress Wallet address to get the ETH from.\n * @returns `transact: (value: bigint) => Promise<Address>` - Used to\n * make the transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public depositETH(walletAddress: Address) {\n const transact = async (value: bigint) =>\n await this.getContract().write.depositETH([walletAddress], {\n account: walletAddress,\n chain: this.viemChain,\n value,\n });\n\n const estimate = async () =>\n await this.getContract().estimateGas.depositETH([walletAddress], {\n account: walletAddress,\n });\n\n return { transact, estimate };\n }\n\n /**\n * Check the pufETH balance of the wallet.\n *\n * @param walletAddress Wallet address to check the balance of.\n * @returns pufETH balance in wei.\n */\n public async balanceOf(walletAddress: Address) {\n return await this.getContract().read.balanceOf([walletAddress]);\n }\n\n /**\n * Get the rate of pufETH compared to ETH.\n *\n * @returns Rate of pufETH compared to 1 ETH.\n */\n public async getPufETHRate() {\n const oneWei = BigInt(1e18);\n return await this.getContract().read.previewDeposit([oneWei]);\n }\n\n /**\n * Get the allowance for the given owner and spender.\n *\n * @param ownerAddress Address of the owner.\n * @param spenderAddress Address of the spender.\n * @returns Allowance for the given owner and spender.\n */\n public async getAllowance(ownerAddress: Address, spenderAddress: Address) {\n return await this.getContract().read.allowance([\n ownerAddress,\n spenderAddress,\n ]);\n }\n\n /**\n * Withdraw pufETH to the given wallet address. This doesn't make the\n * transaction but returns two methods namely `transact` and\n * `estimate`.\n *\n * @param ownerAddress Address of the owner.\n * @param walletAddress Address of the receiver.\n * @param value Value of pufETH to withdraw.\n * @returns `transact: (value: bigint) => Promise<Address>` - Used to\n * make the transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public withdraw(\n ownerAddress: Address,\n walletAddress: Address,\n value: bigint,\n ) {\n const transact = async () =>\n await this.getContract().write.withdraw(\n [value, walletAddress, ownerAddress],\n {\n account: walletAddress,\n chain: this.viemChain,\n },\n );\n\n const estimate = async () =>\n await this.getContract().estimateGas.withdraw(\n [value, walletAddress, ownerAddress],\n {\n account: walletAddress,\n },\n );\n\n return { transact, estimate };\n }\n\n /**\n * Preview the amount of WETH that can be redeemed for the given\n * amount of pufETH using the `.redeem()` method.\n *\n * @param value Value of pufETH to redeem.\n * @returns Preview of the amount of WETH that can be redeemed.\n */\n public previewRedeem(value: bigint) {\n return this.getContract().read.previewRedeem([value]);\n }\n\n /**\n * Calculates the maximum amount of pufETH shares that can be redeemed\n * by the owner.\n *\n * @param ownerAddress Address of the owner's wallet.\n * @returns Maximum amount of pufETH shares that can be redeemed.\n */\n public maxRedeem(ownerAddress: Address) {\n return this.getContract().read.maxRedeem([ownerAddress]);\n }\n\n /**\n * Returns how many basis points of a fee there are when exiting. For\n * example, a 1% fee would mean 1% of the user's requested pufETH is\n * burned (which increases the value for all pufETH holders) before\n * the ETH is redeemed. i.e., you get 1% less ETH back. i.e., you get\n * 1% less ETH back.\n *\n * @returns Basis points of the exit fee.\n */\n public getExitFeeBasisPoints() {\n return this.getContract().read.getExitFeeBasisPoints();\n }\n\n /**\n * Returns how many treasury basis points of a fee there are when\n * exiting. For example, a 1% fee would mean 1% of the user's\n * requested pufETH is burned (which increases the value for all\n * pufETH holders) before the ETH is redeemed.\n *\n * @returns Basis points of the exit fee.\n */\n public getTreasuryExitFeeBasisPoints() {\n return this.getContract().read.getTreasuryExitFeeBasisPoints();\n }\n\n /**\n * Returns how many basis points of a fee there are in total when\n * exiting. For example, a 1% fee would mean 1% of the user's\n * requested pufETH is burned (which increases the value for all\n * pufETH holders) before the ETH is redeemed. i.e., you get 1% less\n * ETH back.\n *\n * @returns Basis points of the exit fee.\n */\n public getTotalExitFeeBasisPoints() {\n return this.getContract().read.getTotalExitFeeBasisPoints();\n }\n\n /**\n * Redeems pufETH shares in exchange for WETH assets from the vault.\n * In the process, the pufETH shares of the owner are burned. This\n * doesn't make the transaction but returns two methods namely\n * `transact` and `estimate`.\n *\n * @param ownerAddress Address of the owner of pufETH.\n * @param receiverAddress Address of the receiver of WETH.\n * @param shares Amount of pufETH shares to redeem.\n * @returns `transact: (value: bigint) => Promise<Address>` - Used to\n * make the transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public redeem(\n ownerAddress: Address,\n receiverAddress: Address,\n shares: bigint,\n ) {\n const transact = async () =>\n await this.getContract().write.redeem(\n [shares, receiverAddress, ownerAddress],\n {\n account: ownerAddress,\n chain: this.viemChain,\n },\n );\n\n const estimate = async () =>\n await this.getContract().estimateGas.redeem(\n [shares, receiverAddress, ownerAddress],\n {\n account: ownerAddress,\n },\n );\n\n return { transact, estimate };\n }\n\n /**\n * Gives exchange rate of pufETH relative to WETH.\n * This does not include any fees, as compared to previewRedeem method.\n *\n * @param amount Amount of pufETH to convert.\n * @returns Amount of equivalent WETH.\n */\n public convertToAssets(amount: bigint) {\n return this.getContract().read.convertToAssets([amount]);\n }\n}\n"],"names":["PufferVaultHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","address","CONTRACT_ADDRESSES","abi","PufferVaultV5","client","getContract","walletAddress","value","oneWei","ownerAddress","spenderAddress","receiverAddress","shares","amount"],"mappings":";;;;;;;AAeO,MAAMA,EAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAa9B,YACUC,GACAC,GACAC,GACR;AAhBM,IAAAC,EAAA;AAaE,SAAA,QAAAH,GACA,KAAA,eAAAC,GACA,KAAA,eAAAC,GAEH,KAAA,YAAYE,EAAYJ,CAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS7B,cAAc;AACnB,UAAMK,IAAUC,EAAmB,KAAK,KAAK,EAAE,aACzCC,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBtC,QAAQE,GAAwBC,GAAe;AAY7C,WAAA,EAAE,UAXQ,YACf,MAAM,KAAK,YAAA,EAAc,MAAM,QAAQ,CAACA,GAAOD,CAAa,GAAG;AAAA,MAC7D,SAASA;AAAA,MACT,OAAO,KAAK;AAAA,IAAA,CACb,GAOgB,UALF,YACf,MAAM,KAAK,YAAA,EAAc,YAAY,QAAQ,CAACC,GAAOD,CAAa,GAAG;AAAA,MACnE,SAASA;AAAA,IAAA,CACV,EAEyB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAevB,WAAWA,GAAwB;AAajC,WAAA,EAAE,UAZQ,OAAOC,MACtB,MAA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1,2 +1,2 @@
1
- "use strict";var h=Object.defineProperty;var l=(n,t,e)=>t in n?h(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var c=(n,t,e)=>l(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../../constants-CxSgz27h.cjs"),C=require("../abis/mainnet/vlPUFFER.cjs"),g=require("./erc20-permit-handler.cjs"),o=require("../tokens.cjs"),d=require("../../getContract-DUA3M2pm.cjs");class m{constructor(t,e,r){c(this,"viemChain");c(this,"erc20PermitHandler");this.chain=t,this.walletClient=e,this.publicClient=r,this.viemChain=u.VIEM_CHAINS[t],this.erc20PermitHandler=new g.ERC20PermitHandler(t,e,r)}getContract(){const t=o.TOKENS_ADDRESSES[o.Token.vlPUFFER][this.chain],e=C.vlPUFFER,r={public:this.publicClient,wallet:this.walletClient};return d.getContract({address:t,abi:e,client:r})}PUFFER(){return this.getContract().read.PUFFER()}decimals(){return this.getContract().read.decimals()}delegates(t){return this.getContract().read.delegates([t])}owner(){return this.getContract().read.owner()}allowance(t,e){return this.getContract().read.allowance([t,e])}transferFrom(t,e,r){return this.getContract().write.transferFrom([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}totalSupply(){return this.getContract().read.totalSupply()}symbol(){return this.getContract().read.symbol()}isPaused(){return this.getContract().read.paused()}async lockInfos(t){const[e,r]=await this.getContract().read.lockInfos([t]);return{pufferAmount:e,unlockTime:r}}getPastTotalSupply(t){return this.getContract().read.getPastTotalSupply([t])}balanceOf(t){return this.getContract().read.balanceOf([t])}nonces(t){return this.getContract().read.nonces([t])}votes(t){return this.getContract().read.getVotes([t])}delegateBySig(t,e,r,a,i,s){return this.getContract().write.delegateBySig([t,e,r,a,i,s],{account:this.walletClient.account,chain:this.viemChain})}transfer(t,e){return this.getContract().write.transfer([t,e],{account:this.walletClient.account,chain:this.viemChain})}getClockMode(){return this.getContract().read.CLOCK_MODE()}numCheckpoints(t){return this.getContract().read.numCheckpoints([t])}approve(t,e){return this.getContract().write.approve([t,e],{account:this.walletClient.account,chain:this.viemChain})}reLock(t,e){return this.getContract().write.reLock([t,e],{account:this.walletClient.account,chain:this.viemChain})}getPastVotes(t,e){return this.getContract().read.getPastVotes([t,e])}checkpoints(t,e){return this.getContract().read.checkpoints([t,e])}name(){return this.getContract().read.name()}createLock(t,e){return this.getContract().write.createLock([t,e],{account:this.walletClient.account,chain:this.viemChain})}createLockWithPermit(t,e,r){return this.getContract().write.createLockWithPermit([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}async lock(t,e,r){if(r)return this.createLock(t,e);const a=this.walletClient.account,i=await this.erc20PermitHandler.withToken(o.Token.PUFFER).getPermitData(a.address,this.getContract().address,t);return this.getContract().write.createLockWithPermit([t,e,i],{account:this.walletClient.account,chain:this.viemChain})}getClock(){return this.getContract().read.clock()}withdraw(t){return this.getContract().write.withdraw([t],{account:this.walletClient.account,chain:this.viemChain})}delegate(t){return this.getContract().write.delegate([t],{account:this.walletClient.account,chain:this.viemChain})}}exports.VLPufferHandler=m;
1
+ "use strict";var C=Object.defineProperty;var d=(n,t,e)=>t in n?C(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>d(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../../constants-CxSgz27h.cjs"),w=require("../abis/mainnet/vlPUFFER.cjs"),m=require("./erc20-permit-handler.cjs"),c=require("../tokens.cjs"),P=require("../../getContract-DUA3M2pm.cjs");class p{constructor(t,e,r){o(this,"viemChain");o(this,"erc20PermitHandler");this.chain=t,this.walletClient=e,this.publicClient=r,this.viemChain=g.VIEM_CHAINS[t],this.erc20PermitHandler=new m.ERC20PermitHandler(t,e,r)}getContract(){const t=c.TOKENS_ADDRESSES[c.Token.vlPUFFER][this.chain],e=w.vlPUFFER,r={public:this.publicClient,wallet:this.walletClient};return P.getContract({address:t,abi:e,client:r})}PUFFER(){return this.getContract().read.PUFFER()}decimals(){return this.getContract().read.decimals()}delegates(t){return this.getContract().read.delegates([t])}owner(){return this.getContract().read.owner()}allowance(t,e){return this.getContract().read.allowance([t,e])}transferFrom(t,e,r){return this.getContract().write.transferFrom([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}totalSupply(){return this.getContract().read.totalSupply()}symbol(){return this.getContract().read.symbol()}isPaused(){return this.getContract().read.paused()}async lockInfos(t){const[e,r]=await this.getContract().read.lockInfos([t]);return{pufferAmount:e,unlockTime:r}}getPastTotalSupply(t){return this.getContract().read.getPastTotalSupply([t])}balanceOf(t){return this.getContract().read.balanceOf([t])}nonces(t){return this.getContract().read.nonces([t])}votes(t){return this.getContract().read.getVotes([t])}delegateBySig(t,e,r,a,i,s){return this.getContract().write.delegateBySig([t,e,r,a,i,s],{account:this.walletClient.account,chain:this.viemChain})}delegatePreapproved(t){return this.getContract().write.delegate([t],{account:this.walletClient.account,chain:this.viemChain})}async delegate(t,e){if(e)return this.delegatePreapproved(t);const r=this.walletClient.account,a=this.erc20PermitHandler.withToken(c.Token.PUFFER),{r:i,s,v:h,deadline:l}=await a.getPermitData(r.address,this.getContract().address,0n),u=await a.nonces(r.address);return this.delegateBySig(t,u,l,h,i,s)}transfer(t,e){return this.getContract().write.transfer([t,e],{account:this.walletClient.account,chain:this.viemChain})}getClockMode(){return this.getContract().read.CLOCK_MODE()}numCheckpoints(t){return this.getContract().read.numCheckpoints([t])}approve(t,e){return this.getContract().write.approve([t,e],{account:this.walletClient.account,chain:this.viemChain})}reLock(t,e){return this.getContract().write.reLock([t,e],{account:this.walletClient.account,chain:this.viemChain})}getPastVotes(t,e){return this.getContract().read.getPastVotes([t,e])}checkpoints(t,e){return this.getContract().read.checkpoints([t,e])}name(){return this.getContract().read.name()}createLock(t,e){return this.getContract().write.createLock([t,e],{account:this.walletClient.account,chain:this.viemChain})}createLockWithPermit(t,e,r){return this.getContract().write.createLockWithPermit([t,e,r],{account:this.walletClient.account,chain:this.viemChain})}async lock(t,e,r){if(r)return this.createLock(t,e);const a=this.walletClient.account,i=await this.erc20PermitHandler.withToken(c.Token.PUFFER).getPermitData(a.address,this.getContract().address,t);return this.getContract().write.createLockWithPermit([t,e,i],{account:this.walletClient.account,chain:this.viemChain})}getClock(){return this.getContract().read.clock()}withdraw(t){return this.getContract().write.withdraw([t],{account:this.walletClient.account,chain:this.viemChain})}}exports.VLPufferHandler=p;
2
2
  //# sourceMappingURL=vl-puffer-handler.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"vl-puffer-handler.cjs","sources":["../../../lib/contracts/handlers/vl-puffer-handler.ts"],"sourcesContent":["import {\n Address,\n GetContractReturnType,\n PublicClient,\n Chain as ViemChain,\n WalletClient,\n getContract,\n Account,\n Hex,\n} from 'viem';\nimport { Chain, VIEM_CHAINS } from '../../chains/constants';\nimport { vlPUFFER } from '../abis/mainnet/vlPUFFER';\nimport { ERC20PermitHandler } from './erc20-permit-handler';\nimport { Token, TOKENS_ADDRESSES } from '../tokens';\nimport { PermitData } from '../common/lib/types';\n\n/**\n * Handler for the `vlPUFFER` contract exposing methods to interact\n * with the contract.\n */\nexport class VLPufferHandler {\n private viemChain: ViemChain;\n private erc20PermitHandler: ERC20PermitHandler;\n\n /**\n * Create the handler for the `vlPUFFER` contract exposing methods to\n * interact with the contract.\n *\n * @param chain Chain to use for the client.\n * @param walletClient The wallet client to use for wallet\n * interactions.\n * @param publicClient The public client to use for public\n * interactions.\n */\n constructor(\n private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n this.erc20PermitHandler = new ERC20PermitHandler(\n chain,\n walletClient,\n publicClient,\n );\n }\n\n /**\n * Get the contract.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = TOKENS_ADDRESSES[Token.vlPUFFER][this.chain] as Address;\n const abi = vlPUFFER;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof vlPUFFER,\n typeof client,\n Address\n >;\n }\n\n /**\n * Get the PUFFER token address.\n *\n * @returns The PUFFER token address.\n */\n public PUFFER() {\n return this.getContract().read.PUFFER();\n }\n\n /**\n * Get the decimals of the token.\n *\n * @returns The decimals.\n */\n public decimals() {\n return this.getContract().read.decimals();\n }\n\n /**\n * Get the delegates for an account.\n *\n * @param account The account to get delegates for.\n * @returns The delegate address.\n */\n public delegates(account: Address) {\n return this.getContract().read.delegates([account]);\n }\n\n /**\n * Get the owner of the contract.\n *\n * @returns The owner address.\n */\n public owner() {\n return this.getContract().read.owner();\n }\n\n /**\n * Get the allowance of the owner for the spender.\n *\n * @param owner The owner of the allowance.\n * @param spender The spender of the allowance.\n * @returns The allowance.\n */\n public allowance(owner: Address, spender: Address) {\n return this.getContract().read.allowance([owner, spender]);\n }\n\n /**\n * Transfer tokens from one address to another.\n *\n * @param from The address to transfer from.\n * @param to The address to transfer to.\n * @param value The amount to transfer.\n * @returns The transaction.\n */\n public transferFrom(from: Address, to: Address, value: bigint) {\n return this.getContract().write.transferFrom([from, to, value], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the total supply of the token.\n *\n * @returns The total supply.\n */\n public totalSupply() {\n return this.getContract().read.totalSupply();\n }\n\n /**\n * Get the symbol of the token.\n *\n * @returns The symbol.\n */\n public symbol() {\n return this.getContract().read.symbol();\n }\n\n /**\n * Check if the contract is paused.\n *\n * @returns True if paused, false otherwise.\n */\n public isPaused() {\n return this.getContract().read.paused();\n }\n\n /**\n * Get the lock information for a user.\n *\n * @param user The user address.\n * @returns The lock information.\n */\n public async lockInfos(user: Address) {\n const [pufferAmount, unlockTime] = await this.getContract().read.lockInfos([\n user,\n ]);\n\n return { pufferAmount, unlockTime };\n }\n\n /**\n * Get the past total supply at a specific timepoint.\n *\n * @param timepoint The timepoint to get the total supply for.\n * @returns The past total supply.\n */\n public getPastTotalSupply(timepoint: bigint) {\n return this.getContract().read.getPastTotalSupply([timepoint]);\n }\n\n /**\n * Get the balance for an address.\n *\n * @param account The address to get the balance of.\n * @returns The balance.\n */\n public balanceOf(account: Address) {\n return this.getContract().read.balanceOf([account]);\n }\n\n /**\n * Get the nonce for an owner.\n *\n * @param owner The owner address.\n * @returns The nonce.\n */\n public nonces(owner: Address) {\n return this.getContract().read.nonces([owner]);\n }\n\n /**\n * Get the votes for an account.\n *\n * @param account The account to get votes for.\n * @returns The votes.\n */\n public votes(account: Address) {\n return this.getContract().read.getVotes([account]);\n }\n\n /**\n * Delegate by signature.\n *\n * @param delegatee The delegatee address.\n * @param nonce The nonce.\n * @param expiry The expiry time.\n * @param v The v component of the signature.\n * @param r The r component of the signature.\n * @param s The s component of the signature.\n * @returns The transaction.\n */\n public delegateBySig(\n delegatee: Address,\n nonce: bigint,\n expiry: bigint,\n v: number,\n r: Hex,\n s: Hex,\n ) {\n return this.getContract().write.delegateBySig(\n [delegatee, nonce, expiry, v, r, s],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Transfer tokens to another address.\n *\n * @param to The address to transfer to.\n * @param value The amount to transfer.\n * @returns The transaction.\n */\n public transfer(to: Address, value: bigint) {\n return this.getContract().write.transfer([to, value], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the clock mode.\n *\n * @returns The clock mode.\n */\n public getClockMode() {\n return this.getContract().read.CLOCK_MODE();\n }\n\n /**\n * Get the number of checkpoints for an account.\n *\n * @param account The account to get checkpoints for.\n * @returns The number of checkpoints.\n */\n public numCheckpoints(account: Address) {\n return this.getContract().read.numCheckpoints([account]);\n }\n\n /**\n * Approve a spender to spend tokens.\n *\n * @param spender The spender address.\n * @param value The amount to approve.\n * @returns The transaction.\n */\n public approve(spender: Address, value: bigint) {\n return this.getContract().write.approve([spender, value], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Re-lock with the specified amount and multiplier.\n *\n * @param amount The amount to re-lock.\n * @param multiplier The multiplier for the re-lock.\n * @returns The transaction.\n */\n public reLock(amount: bigint, multiplier: bigint) {\n return this.getContract().write.reLock([amount, multiplier], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the past votes for an account at a specific timepoint.\n *\n * @param account The account to get past votes for.\n * @param timepoint The timepoint to get votes for.\n * @returns The past votes.\n */\n public getPastVotes(account: Address, timepoint: bigint) {\n return this.getContract().read.getPastVotes([account, timepoint]);\n }\n\n /**\n * Get the checkpoints for an account at a specific position.\n *\n * @param account The account to get checkpoints for.\n * @param pos The position of the checkpoint.\n * @returns The checkpoint.\n */\n public checkpoints(account: Address, pos: number) {\n return this.getContract().read.checkpoints([account, pos]);\n }\n\n /**\n * Get the name of the token.\n *\n * @returns The name.\n */\n public name() {\n return this.getContract().read.name();\n }\n\n /**\n * Create a lock with the specified amount and multiplier.\n *\n * @param amount The amount to lock.\n * @param multiplier The multiplier for the lock.\n * @returns The transaction.\n */\n public createLock(amount: bigint, multiplier: bigint) {\n return this.getContract().write.createLock([amount, multiplier], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Create a lock with permit.\n *\n * @param value The amount to lock.\n * @param multiplier The multiplier for the lock.\n * @param permitData The permit data.\n * @returns The transaction.\n */\n public createLockWithPermit(\n value: bigint,\n multiplier: bigint,\n permitData: PermitData,\n ) {\n return this.getContract().write.createLockWithPermit(\n [value, multiplier, permitData],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Create a lock with permit.\n *\n * @param value The amount to lock.\n * @param multiplier The multiplier for the lock.\n * @param isPreapproved Whether the PUFFER token is preapproved.\n * @returns The transaction.\n */\n public async lock(value: bigint, multiplier: bigint, isPreapproved: boolean) {\n if (isPreapproved) {\n return this.createLock(value, multiplier);\n }\n\n const account = this.walletClient.account as Account;\n // Internally create a permit signature for the PUFFER token.\n const permitData = await this.erc20PermitHandler\n .withToken(Token.PUFFER)\n .getPermitData(account.address, this.getContract().address, value);\n\n // Create a lock with the permit data.\n return this.getContract().write.createLockWithPermit(\n [value, multiplier, permitData],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Get the current clock value.\n *\n * @returns The clock value.\n */\n public getClock() {\n return this.getContract().read.clock();\n }\n\n /**\n * Withdraw tokens to a recipient.\n *\n * @param recipient The recipient address.\n * @returns The transaction.\n */\n public withdraw(recipient: Address) {\n return this.getContract().write.withdraw([recipient], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Delegate votes to another address.\n *\n * @param delegatee The delegatee address.\n * @returns The transaction.\n */\n public delegate(delegatee: Address) {\n return this.getContract().write.delegate([delegatee], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n}\n"],"names":["VLPufferHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","ERC20PermitHandler","address","TOKENS_ADDRESSES","Token","abi","vlPUFFER","client","getContract","account","owner","spender","from","to","value","user","pufferAmount","unlockTime","timepoint","delegatee","nonce","expiry","v","r","amount","multiplier","pos","permitData","isPreapproved","recipient"],"mappings":"6bAoBO,MAAMA,CAAgB,CAc3B,YACUC,EACAC,EACAC,EACR,CAjBMC,EAAA,kBACAA,EAAA,2BAaE,KAAA,MAAAH,EACA,KAAA,aAAAC,EACA,KAAA,aAAAC,EAEH,KAAA,UAAYE,cAAYJ,CAAK,EAClC,KAAK,mBAAqB,IAAIK,EAAA,mBAC5BL,EACAC,EACAC,CACF,CAAA,CAQK,aAAc,CACnB,MAAMI,EAAUC,EAAAA,iBAAiBC,EAAAA,MAAM,QAAQ,EAAE,KAAK,KAAK,EACrDC,EAAMC,EAAA,SACNC,EAAS,CAAE,OAAQ,KAAK,aAAc,OAAQ,KAAK,YAAa,EAEtE,OAAOC,EAAY,YAAA,CAAE,QAAAN,EAAS,IAAAG,EAAK,OAAAE,EAAQ,CAAA,CAYtC,QAAS,CACd,OAAO,KAAK,cAAc,KAAK,OAA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AAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CAEhB,CAAA,CAWF,MAAa,KAAKb,EAAeW,EAAoBG,EAAwB,CAC3E,GAAIA,EACK,OAAA,KAAK,WAAWd,EAAOW,CAAU,EAGpC,MAAAhB,EAAU,KAAK,aAAa,QAE5BkB,EAAa,MAAM,KAAK,mBAC3B,UAAUvB,EAAM,MAAA,MAAM,EACtB,cAAcK,EAAQ,QAAS,KAAK,YAAY,EAAE,QAASK,CAAK,EAG5D,OAAA,KAAK,cAAc,MAAM,qBAC9B,CAACA,EAAOW,EAAYE,CAAU,EAC9B,CACE,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CAEhB,CAAA,CAQK,UAAW,CAChB,OAAO,KAAK,cAAc,KAAK,MAAM,CAAA,CAShC,SAASE,EAAoB,CAClC,OAAO,KAAK,YAAY,EAAE,MAAM,SAAS,CAACA,CAAS,EAAG,CACpD,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CACb,CAAA,CASI,SAASV,EAAoB,CAClC,OAAO,KAAK,YAAY,EAAE,MAAM,SAAS,CAACA,CAAS,EAAG,CACpD,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CACb,CAAA,CAEL"}
1
+ {"version":3,"file":"vl-puffer-handler.cjs","sources":["../../../lib/contracts/handlers/vl-puffer-handler.ts"],"sourcesContent":["import {\n Address,\n GetContractReturnType,\n PublicClient,\n Chain as ViemChain,\n WalletClient,\n getContract,\n Account,\n Hex,\n} from 'viem';\nimport { Chain, VIEM_CHAINS } from '../../chains/constants';\nimport { vlPUFFER } from '../abis/mainnet/vlPUFFER';\nimport { ERC20PermitHandler } from './erc20-permit-handler';\nimport { Token, TOKENS_ADDRESSES } from '../tokens';\nimport { PermitData } from '../common/lib/types';\n\n/**\n * Handler for the `vlPUFFER` contract exposing methods to interact\n * with the contract.\n */\nexport class VLPufferHandler {\n private viemChain: ViemChain;\n private erc20PermitHandler: ERC20PermitHandler;\n\n /**\n * Create the handler for the `vlPUFFER` contract exposing methods to\n * interact with the contract.\n *\n * @param chain Chain to use for the client.\n * @param walletClient The wallet client to use for wallet\n * interactions.\n * @param publicClient The public client to use for public\n * interactions.\n */\n constructor(\n private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n this.erc20PermitHandler = new ERC20PermitHandler(\n chain,\n walletClient,\n publicClient,\n );\n }\n\n /**\n * Get the contract.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = TOKENS_ADDRESSES[Token.vlPUFFER][this.chain] as Address;\n const abi = vlPUFFER;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof vlPUFFER,\n typeof client,\n Address\n >;\n }\n\n /**\n * Get the PUFFER token address.\n *\n * @returns The PUFFER token address.\n */\n public PUFFER() {\n return this.getContract().read.PUFFER();\n }\n\n /**\n * Get the decimals of the token.\n *\n * @returns The decimals.\n */\n public decimals() {\n return this.getContract().read.decimals();\n }\n\n /**\n * Get the delegates for an account.\n *\n * @param account The account to get delegates for.\n * @returns The delegate address.\n */\n public delegates(account: Address) {\n return this.getContract().read.delegates([account]);\n }\n\n /**\n * Get the owner of the contract.\n *\n * @returns The owner address.\n */\n public owner() {\n return this.getContract().read.owner();\n }\n\n /**\n * Get the allowance of the owner for the spender.\n *\n * @param owner The owner of the allowance.\n * @param spender The spender of the allowance.\n * @returns The allowance.\n */\n public allowance(owner: Address, spender: Address) {\n return this.getContract().read.allowance([owner, spender]);\n }\n\n /**\n * Transfer tokens from one address to another.\n *\n * @param from The address to transfer from.\n * @param to The address to transfer to.\n * @param value The amount to transfer.\n * @returns The transaction.\n */\n public transferFrom(from: Address, to: Address, value: bigint) {\n return this.getContract().write.transferFrom([from, to, value], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the total supply of the token.\n *\n * @returns The total supply.\n */\n public totalSupply() {\n return this.getContract().read.totalSupply();\n }\n\n /**\n * Get the symbol of the token.\n *\n * @returns The symbol.\n */\n public symbol() {\n return this.getContract().read.symbol();\n }\n\n /**\n * Check if the contract is paused.\n *\n * @returns True if paused, false otherwise.\n */\n public isPaused() {\n return this.getContract().read.paused();\n }\n\n /**\n * Get the lock information for a user.\n *\n * @param user The user address.\n * @returns The lock information.\n */\n public async lockInfos(user: Address) {\n const [pufferAmount, unlockTime] = await this.getContract().read.lockInfos([\n user,\n ]);\n\n return { pufferAmount, unlockTime };\n }\n\n /**\n * Get the past total supply at a specific timepoint.\n *\n * @param timepoint The timepoint to get the total supply for.\n * @returns The past total supply.\n */\n public getPastTotalSupply(timepoint: bigint) {\n return this.getContract().read.getPastTotalSupply([timepoint]);\n }\n\n /**\n * Get the balance for an address.\n *\n * @param account The address to get the balance of.\n * @returns The balance.\n */\n public balanceOf(account: Address) {\n return this.getContract().read.balanceOf([account]);\n }\n\n /**\n * Get the nonce for an owner.\n *\n * @param owner The owner address.\n * @returns The nonce.\n */\n public nonces(owner: Address) {\n return this.getContract().read.nonces([owner]);\n }\n\n /**\n * Get the votes for an account.\n *\n * @param account The account to get votes for.\n * @returns The votes.\n */\n public votes(account: Address) {\n return this.getContract().read.getVotes([account]);\n }\n\n /**\n * Delegate by signature.\n *\n * @param delegatee The delegatee address.\n * @param nonce The nonce.\n * @param expiry The expiry time.\n * @param v The v component of the signature.\n * @param r The r component of the signature.\n * @param s The s component of the signature.\n * @returns The transaction.\n */\n public delegateBySig(\n delegatee: Address,\n nonce: bigint,\n expiry: bigint,\n v: number,\n r: Hex,\n s: Hex,\n ) {\n return this.getContract().write.delegateBySig(\n [delegatee, nonce, expiry, v, r, s],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Delegate votes to another address.\n *\n * @param delegatee The delegatee address.\n * @returns The transaction.\n */\n public delegatePreapproved(delegatee: Address) {\n return this.getContract().write.delegate([delegatee], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Delegate votes to another address.\n *\n * @param delegatee The delegatee address.\n * @param isPreapproved Whether the PUFFER token is preapproved or\n * should use a permit signature.\n * @returns The transaction.\n */\n public async delegate(delegatee: Address, isPreapproved: boolean) {\n if (isPreapproved) {\n return this.delegatePreapproved(delegatee);\n }\n\n const account = this.walletClient.account as Account;\n // Internally create a permit signature for the PUFFER token.\n const permitHandler = this.erc20PermitHandler.withToken(Token.PUFFER);\n const { r, s, v, deadline } = await permitHandler.getPermitData(\n account.address,\n this.getContract().address,\n 0n,\n );\n const nonces = await permitHandler.nonces(account.address);\n\n return this.delegateBySig(delegatee, nonces, deadline, v, r, s);\n }\n\n /**\n * Transfer tokens to another address.\n *\n * @param to The address to transfer to.\n * @param value The amount to transfer.\n * @returns The transaction.\n */\n public transfer(to: Address, value: bigint) {\n return this.getContract().write.transfer([to, value], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the clock mode.\n *\n * @returns The clock mode.\n */\n public getClockMode() {\n return this.getContract().read.CLOCK_MODE();\n }\n\n /**\n * Get the number of checkpoints for an account.\n *\n * @param account The account to get checkpoints for.\n * @returns The number of checkpoints.\n */\n public numCheckpoints(account: Address) {\n return this.getContract().read.numCheckpoints([account]);\n }\n\n /**\n * Approve a spender to spend tokens.\n *\n * @param spender The spender address.\n * @param value The amount to approve.\n * @returns The transaction.\n */\n public approve(spender: Address, value: bigint) {\n return this.getContract().write.approve([spender, value], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Re-lock with the specified amount and multiplier.\n *\n * @param amount The amount to re-lock.\n * @param multiplier The multiplier for the re-lock.\n * @returns The transaction.\n */\n public reLock(amount: bigint, multiplier: bigint) {\n return this.getContract().write.reLock([amount, multiplier], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the past votes for an account at a specific timepoint.\n *\n * @param account The account to get past votes for.\n * @param timepoint The timepoint to get votes for.\n * @returns The past votes.\n */\n public getPastVotes(account: Address, timepoint: bigint) {\n return this.getContract().read.getPastVotes([account, timepoint]);\n }\n\n /**\n * Get the checkpoints for an account at a specific position.\n *\n * @param account The account to get checkpoints for.\n * @param pos The position of the checkpoint.\n * @returns The checkpoint.\n */\n public checkpoints(account: Address, pos: number) {\n return this.getContract().read.checkpoints([account, pos]);\n }\n\n /**\n * Get the name of the token.\n *\n * @returns The name.\n */\n public name() {\n return this.getContract().read.name();\n }\n\n /**\n * Create a lock with the specified amount and multiplier.\n *\n * @param amount The amount to lock.\n * @param multiplier The multiplier for the lock.\n * @returns The transaction.\n */\n public createLock(amount: bigint, multiplier: bigint) {\n return this.getContract().write.createLock([amount, multiplier], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Create a lock with permit.\n *\n * @param value The amount to lock.\n * @param multiplier The multiplier for the lock.\n * @param permitData The permit data.\n * @returns The transaction.\n */\n public createLockWithPermit(\n value: bigint,\n multiplier: bigint,\n permitData: PermitData,\n ) {\n return this.getContract().write.createLockWithPermit(\n [value, multiplier, permitData],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Create a lock with permit.\n *\n * @param value The amount to lock.\n * @param multiplier The multiplier for the lock.\n * @param isPreapproved Whether the PUFFER token is preapproved.\n * @returns The transaction.\n */\n public async lock(value: bigint, multiplier: bigint, isPreapproved: boolean) {\n if (isPreapproved) {\n return this.createLock(value, multiplier);\n }\n\n const account = this.walletClient.account as Account;\n // Internally create a permit signature for the PUFFER token.\n const permitData = await this.erc20PermitHandler\n .withToken(Token.PUFFER)\n .getPermitData(account.address, this.getContract().address, value);\n\n // Create a lock with the permit data.\n return this.getContract().write.createLockWithPermit(\n [value, multiplier, permitData],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Get the current clock value.\n *\n * @returns The clock value.\n */\n public getClock() {\n return this.getContract().read.clock();\n }\n\n /**\n * Withdraw tokens to a recipient.\n *\n * @param recipient The recipient address.\n * @returns The transaction.\n */\n public withdraw(recipient: Address) {\n return this.getContract().write.withdraw([recipient], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n}\n"],"names":["VLPufferHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","ERC20PermitHandler","address","TOKENS_ADDRESSES","Token","abi","vlPUFFER","client","getContract","account","owner","spender","from","to","value","user","pufferAmount","unlockTime","timepoint","delegatee","nonce","expiry","v","r","isPreapproved","permitHandler","deadline","nonces","amount","multiplier","pos","permitData","recipient"],"mappings":"6bAoBO,MAAMA,CAAgB,CAc3B,YACUC,EACAC,EACAC,EACR,CAjBMC,EAAA,kBACAA,EAAA,2BAaE,KAAA,MAAAH,EACA,KAAA,aAAAC,EACA,KAAA,aAAAC,EAEH,KAAA,UAAYE,cAAYJ,CAAK,EAClC,KAAK,mBAAqB,IAAIK,EAAA,mBAC5BL,EACAC,EACAC,CACF,CAAA,CAQK,aAAc,CACnB,MAAMI,EAAUC,EAAAA,iBAAiBC,EAAAA,MAAM,QAAQ,EAAE,KAAK,KAAK,EACrDC,EAAMC,EAAA,SACNC,EAAS,CAAE,OAAQ,KAAK,aAAc,OAAQ,KAAK,YAAa,EAEtE,OAAOC,EAAY,YAAA,CAAE,QAAAN,EAAS,IAAAG,EAAK,OAAAE,EAAQ,CAAA,CAYtC,QAAS,CACd,OAAO,KAAK,cAAc,KAAK,OAAO,CAAA,CAQjC,UAAW,CAChB,OAAO,KAAK,cAAc,KAAK,SAAS,CAAA,CASnC,UAAUE,EAAkB,CACjC,OAAO,KAAK,YAAY,EAAE,KAAK,UAAU,CAACA,CAAO,CAAC,CAAA,CAQ7C,OAAQ,CACb,OAAO,KAAK,cAAc,KAAK,MAAM,CAAA,CAUhC,UAAUC,EAAgBC,EAAkB,CAC1C,OAAA,KAAK,cAAc,KAAK,UAAU,CAACD,EAAOC,CAAO,CAAC,CAAA,CAWpD,aAAaC,EAAeC,EAAaC,EA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A,KAAK,cAAc,MAAM,WAAW,CAACD,EAAQC,CAAU,EAAG,CAC/D,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CACb,CAAA,CAWI,qBACLf,EACAe,EACAE,EACA,CACO,OAAA,KAAK,cAAc,MAAM,qBAC9B,CAACjB,EAAOe,EAAYE,CAAU,EAC9B,CACE,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CAEhB,CAAA,CAWF,MAAa,KAAKjB,EAAee,EAAoBL,EAAwB,CAC3E,GAAIA,EACK,OAAA,KAAK,WAAWV,EAAOe,CAAU,EAGpC,MAAApB,EAAU,KAAK,aAAa,QAE5BsB,EAAa,MAAM,KAAK,mBAC3B,UAAU3B,EAAM,MAAA,MAAM,EACtB,cAAcK,EAAQ,QAAS,KAAK,YAAY,EAAE,QAASK,CAAK,EAG5D,OAAA,KAAK,cAAc,MAAM,qBAC9B,CAACA,EAAOe,EAAYE,CAAU,EAC9B,CACE,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CAEhB,CAAA,CAQK,UAAW,CAChB,OAAO,KAAK,cAAc,KAAK,MAAM,CAAA,CAShC,SAASC,EAAoB,CAClC,OAAO,KAAK,YAAY,EAAE,MAAM,SAAS,CAACA,CAAS,EAAG,CACpD,QAAS,KAAK,aAAa,QAC3B,MAAO,KAAK,SAAA,CACb,CAAA,CAEL"}
@@ -14691,6 +14691,22 @@ export declare class VLPufferHandler {
14691
14691
  * @returns The transaction.
14692
14692
  */
14693
14693
  delegateBySig(delegatee: Address, nonce: bigint, expiry: bigint, v: number, r: Hex, s: Hex): Promise<`0x${string}`>;
14694
+ /**
14695
+ * Delegate votes to another address.
14696
+ *
14697
+ * @param delegatee The delegatee address.
14698
+ * @returns The transaction.
14699
+ */
14700
+ delegatePreapproved(delegatee: Address): Promise<`0x${string}`>;
14701
+ /**
14702
+ * Delegate votes to another address.
14703
+ *
14704
+ * @param delegatee The delegatee address.
14705
+ * @param isPreapproved Whether the PUFFER token is preapproved or
14706
+ * should use a permit signature.
14707
+ * @returns The transaction.
14708
+ */
14709
+ delegate(delegatee: Address, isPreapproved: boolean): Promise<`0x${string}`>;
14694
14710
  /**
14695
14711
  * Transfer tokens to another address.
14696
14712
  *
@@ -14792,11 +14808,4 @@ export declare class VLPufferHandler {
14792
14808
  * @returns The transaction.
14793
14809
  */
14794
14810
  withdraw(recipient: Address): Promise<`0x${string}`>;
14795
- /**
14796
- * Delegate votes to another address.
14797
- *
14798
- * @param delegatee The delegatee address.
14799
- * @returns The transaction.
14800
- */
14801
- delegate(delegatee: Address): Promise<`0x${string}`>;
14802
14811
  }
@@ -1,12 +1,12 @@
1
- var h = Object.defineProperty;
2
- var l = (a, t, e) => t in a ? h(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var c = (a, t, e) => l(a, typeof t != "symbol" ? t + "" : t, e);
4
- import { V as u } from "../../constants-C9YZ6Ewc.js";
5
- import { vlPUFFER as C } from "../abis/mainnet/vlPUFFER.js";
6
- import { ERC20PermitHandler as g } from "./erc20-permit-handler.js";
7
- import { TOKENS_ADDRESSES as d, Token as o } from "../tokens.js";
8
- import { g as m } from "../../getContract-DEPNMZxg.js";
9
- class F {
1
+ var C = Object.defineProperty;
2
+ var d = (a, t, e) => t in a ? C(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var o = (a, t, e) => d(a, typeof t != "symbol" ? t + "" : t, e);
4
+ import { V as g } from "../../constants-C9YZ6Ewc.js";
5
+ import { vlPUFFER as m } from "../abis/mainnet/vlPUFFER.js";
6
+ import { ERC20PermitHandler as w } from "./erc20-permit-handler.js";
7
+ import { TOKENS_ADDRESSES as p, Token as s } from "../tokens.js";
8
+ import { g as P } from "../../getContract-DEPNMZxg.js";
9
+ class S {
10
10
  /**
11
11
  * Create the handler for the `vlPUFFER` contract exposing methods to
12
12
  * interact with the contract.
@@ -18,9 +18,9 @@ class F {
18
18
  * interactions.
19
19
  */
20
20
  constructor(t, e, r) {
21
- c(this, "viemChain");
22
- c(this, "erc20PermitHandler");
23
- this.chain = t, this.walletClient = e, this.publicClient = r, this.viemChain = u[t], this.erc20PermitHandler = new g(
21
+ o(this, "viemChain");
22
+ o(this, "erc20PermitHandler");
23
+ this.chain = t, this.walletClient = e, this.publicClient = r, this.viemChain = g[t], this.erc20PermitHandler = new w(
24
24
  t,
25
25
  e,
26
26
  r
@@ -32,8 +32,8 @@ class F {
32
32
  * @returns The viem contract.
33
33
  */
34
34
  getContract() {
35
- const t = d[o.vlPUFFER][this.chain], e = C, r = { public: this.publicClient, wallet: this.walletClient };
36
- return m({ address: t, abi: e, client: r });
35
+ const t = p[s.vlPUFFER][this.chain], e = m, r = { public: this.publicClient, wallet: this.walletClient };
36
+ return P({ address: t, abi: e, client: r });
37
37
  }
38
38
  /**
39
39
  * Get the PUFFER token address.
@@ -175,15 +175,45 @@ class F {
175
175
  * @param s The s component of the signature.
176
176
  * @returns The transaction.
177
177
  */
178
- delegateBySig(t, e, r, n, i, s) {
178
+ delegateBySig(t, e, r, n, i, c) {
179
179
  return this.getContract().write.delegateBySig(
180
- [t, e, r, n, i, s],
180
+ [t, e, r, n, i, c],
181
181
  {
182
182
  account: this.walletClient.account,
183
183
  chain: this.viemChain
184
184
  }
185
185
  );
186
186
  }
187
+ /**
188
+ * Delegate votes to another address.
189
+ *
190
+ * @param delegatee The delegatee address.
191
+ * @returns The transaction.
192
+ */
193
+ delegatePreapproved(t) {
194
+ return this.getContract().write.delegate([t], {
195
+ account: this.walletClient.account,
196
+ chain: this.viemChain
197
+ });
198
+ }
199
+ /**
200
+ * Delegate votes to another address.
201
+ *
202
+ * @param delegatee The delegatee address.
203
+ * @param isPreapproved Whether the PUFFER token is preapproved or
204
+ * should use a permit signature.
205
+ * @returns The transaction.
206
+ */
207
+ async delegate(t, e) {
208
+ if (e)
209
+ return this.delegatePreapproved(t);
210
+ const r = this.walletClient.account, n = this.erc20PermitHandler.withToken(s.PUFFER), { r: i, s: c, v: h, deadline: l } = await n.getPermitData(
211
+ r.address,
212
+ this.getContract().address,
213
+ 0n
214
+ ), u = await n.nonces(r.address);
215
+ return this.delegateBySig(t, u, l, h, i, c);
216
+ }
187
217
  /**
188
218
  * Transfer tokens to another address.
189
219
  *
@@ -309,7 +339,7 @@ class F {
309
339
  async lock(t, e, r) {
310
340
  if (r)
311
341
  return this.createLock(t, e);
312
- const n = this.walletClient.account, i = await this.erc20PermitHandler.withToken(o.PUFFER).getPermitData(n.address, this.getContract().address, t);
342
+ const n = this.walletClient.account, i = await this.erc20PermitHandler.withToken(s.PUFFER).getPermitData(n.address, this.getContract().address, t);
313
343
  return this.getContract().write.createLockWithPermit(
314
344
  [t, e, i],
315
345
  {
@@ -338,20 +368,8 @@ class F {
338
368
  chain: this.viemChain
339
369
  });
340
370
  }
341
- /**
342
- * Delegate votes to another address.
343
- *
344
- * @param delegatee The delegatee address.
345
- * @returns The transaction.
346
- */
347
- delegate(t) {
348
- return this.getContract().write.delegate([t], {
349
- account: this.walletClient.account,
350
- chain: this.viemChain
351
- });
352
- }
353
371
  }
354
372
  export {
355
- F as VLPufferHandler
373
+ S as VLPufferHandler
356
374
  };
357
375
  //# sourceMappingURL=vl-puffer-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"vl-puffer-handler.js","sources":["../../../lib/contracts/handlers/vl-puffer-handler.ts"],"sourcesContent":["import {\n Address,\n GetContractReturnType,\n PublicClient,\n Chain as ViemChain,\n WalletClient,\n getContract,\n Account,\n Hex,\n} from 'viem';\nimport { Chain, VIEM_CHAINS } from '../../chains/constants';\nimport { vlPUFFER } from '../abis/mainnet/vlPUFFER';\nimport { ERC20PermitHandler } from './erc20-permit-handler';\nimport { Token, TOKENS_ADDRESSES } from '../tokens';\nimport { PermitData } from '../common/lib/types';\n\n/**\n * Handler for the `vlPUFFER` contract exposing methods to interact\n * with the contract.\n */\nexport class VLPufferHandler {\n private viemChain: ViemChain;\n private erc20PermitHandler: ERC20PermitHandler;\n\n /**\n * Create the handler for the `vlPUFFER` contract exposing methods to\n * interact with the contract.\n *\n * @param chain Chain to use for the client.\n * @param walletClient The wallet client to use for wallet\n * interactions.\n * @param publicClient The public client to use for public\n * interactions.\n */\n constructor(\n private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n this.erc20PermitHandler = new ERC20PermitHandler(\n chain,\n walletClient,\n publicClient,\n );\n }\n\n /**\n * Get the contract.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = TOKENS_ADDRESSES[Token.vlPUFFER][this.chain] as Address;\n const abi = vlPUFFER;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof vlPUFFER,\n typeof client,\n Address\n >;\n }\n\n /**\n * Get the PUFFER token address.\n *\n * @returns The PUFFER token address.\n */\n public PUFFER() {\n return this.getContract().read.PUFFER();\n }\n\n /**\n * Get the decimals of the token.\n *\n * @returns The decimals.\n */\n public decimals() {\n return this.getContract().read.decimals();\n }\n\n /**\n * Get the delegates for an account.\n *\n * @param account The account to get delegates for.\n * @returns The delegate address.\n */\n public delegates(account: Address) {\n return this.getContract().read.delegates([account]);\n }\n\n /**\n * Get the owner of the contract.\n *\n * @returns The owner address.\n */\n public owner() {\n return this.getContract().read.owner();\n }\n\n /**\n * Get the allowance of the owner for the spender.\n *\n * @param owner The owner of the allowance.\n * @param spender The spender of the allowance.\n * @returns The allowance.\n */\n public allowance(owner: Address, spender: Address) {\n return this.getContract().read.allowance([owner, spender]);\n }\n\n /**\n * Transfer tokens from one address to another.\n *\n * @param from The address to transfer from.\n * @param to The address to transfer to.\n * @param value The amount to transfer.\n * @returns The transaction.\n */\n public transferFrom(from: Address, to: Address, value: bigint) {\n return this.getContract().write.transferFrom([from, to, value], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the total supply of the token.\n *\n * @returns The total supply.\n */\n public totalSupply() {\n return this.getContract().read.totalSupply();\n }\n\n /**\n * Get the symbol of the token.\n *\n * @returns The symbol.\n */\n public symbol() {\n return this.getContract().read.symbol();\n }\n\n /**\n * Check if the contract is paused.\n *\n * @returns True if paused, false otherwise.\n */\n public isPaused() {\n return this.getContract().read.paused();\n }\n\n /**\n * Get the lock information for a user.\n *\n * @param user The user address.\n * @returns The lock information.\n */\n public async lockInfos(user: Address) {\n const [pufferAmount, unlockTime] = await this.getContract().read.lockInfos([\n user,\n ]);\n\n return { pufferAmount, unlockTime };\n }\n\n /**\n * Get the past total supply at a specific timepoint.\n *\n * @param timepoint The timepoint to get the total supply for.\n * @returns The past total supply.\n */\n public getPastTotalSupply(timepoint: bigint) {\n return this.getContract().read.getPastTotalSupply([timepoint]);\n }\n\n /**\n * Get the balance for an address.\n *\n * @param account The address to get the balance of.\n * @returns The balance.\n */\n public balanceOf(account: Address) {\n return this.getContract().read.balanceOf([account]);\n }\n\n /**\n * Get the nonce for an owner.\n *\n * @param owner The owner address.\n * @returns The nonce.\n */\n public nonces(owner: Address) {\n return this.getContract().read.nonces([owner]);\n }\n\n /**\n * Get the votes for an account.\n *\n * @param account The account to get votes for.\n * @returns The votes.\n */\n public votes(account: Address) {\n return this.getContract().read.getVotes([account]);\n }\n\n /**\n * Delegate by signature.\n *\n * @param delegatee The delegatee address.\n * @param nonce The nonce.\n * @param expiry The expiry time.\n * @param v The v component of the signature.\n * @param r The r component of the signature.\n * @param s The s component of the signature.\n * @returns The transaction.\n */\n public delegateBySig(\n delegatee: Address,\n nonce: bigint,\n expiry: bigint,\n v: number,\n r: Hex,\n s: Hex,\n ) {\n return this.getContract().write.delegateBySig(\n [delegatee, nonce, expiry, v, r, s],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Transfer tokens to another address.\n *\n * @param to The address to transfer to.\n * @param value The amount to transfer.\n * @returns The transaction.\n */\n public transfer(to: Address, value: bigint) {\n return this.getContract().write.transfer([to, value], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the clock mode.\n *\n * @returns The clock mode.\n */\n public getClockMode() {\n return this.getContract().read.CLOCK_MODE();\n }\n\n /**\n * Get the number of checkpoints for an account.\n *\n * @param account The account to get checkpoints for.\n * @returns The number of checkpoints.\n */\n public numCheckpoints(account: Address) {\n return this.getContract().read.numCheckpoints([account]);\n }\n\n /**\n * Approve a spender to spend tokens.\n *\n * @param spender The spender address.\n * @param value The amount to approve.\n * @returns The transaction.\n */\n public approve(spender: Address, value: bigint) {\n return this.getContract().write.approve([spender, value], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Re-lock with the specified amount and multiplier.\n *\n * @param amount The amount to re-lock.\n * @param multiplier The multiplier for the re-lock.\n * @returns The transaction.\n */\n public reLock(amount: bigint, multiplier: bigint) {\n return this.getContract().write.reLock([amount, multiplier], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the past votes for an account at a specific timepoint.\n *\n * @param account The account to get past votes for.\n * @param timepoint The timepoint to get votes for.\n * @returns The past votes.\n */\n public getPastVotes(account: Address, timepoint: bigint) {\n return this.getContract().read.getPastVotes([account, timepoint]);\n }\n\n /**\n * Get the checkpoints for an account at a specific position.\n *\n * @param account The account to get checkpoints for.\n * @param pos The position of the checkpoint.\n * @returns The checkpoint.\n */\n public checkpoints(account: Address, pos: number) {\n return this.getContract().read.checkpoints([account, pos]);\n }\n\n /**\n * Get the name of the token.\n *\n * @returns The name.\n */\n public name() {\n return this.getContract().read.name();\n }\n\n /**\n * Create a lock with the specified amount and multiplier.\n *\n * @param amount The amount to lock.\n * @param multiplier The multiplier for the lock.\n * @returns The transaction.\n */\n public createLock(amount: bigint, multiplier: bigint) {\n return this.getContract().write.createLock([amount, multiplier], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Create a lock with permit.\n *\n * @param value The amount to lock.\n * @param multiplier The multiplier for the lock.\n * @param permitData The permit data.\n * @returns The transaction.\n */\n public createLockWithPermit(\n value: bigint,\n multiplier: bigint,\n permitData: PermitData,\n ) {\n return this.getContract().write.createLockWithPermit(\n [value, multiplier, permitData],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Create a lock with permit.\n *\n * @param value The amount to lock.\n * @param multiplier The multiplier for the lock.\n * @param isPreapproved Whether the PUFFER token is preapproved.\n * @returns The transaction.\n */\n public async lock(value: bigint, multiplier: bigint, isPreapproved: boolean) {\n if (isPreapproved) {\n return this.createLock(value, multiplier);\n }\n\n const account = this.walletClient.account as Account;\n // Internally create a permit signature for the PUFFER token.\n const permitData = await this.erc20PermitHandler\n .withToken(Token.PUFFER)\n .getPermitData(account.address, this.getContract().address, value);\n\n // Create a lock with the permit data.\n return this.getContract().write.createLockWithPermit(\n [value, multiplier, permitData],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Get the current clock value.\n *\n * @returns The clock value.\n */\n public getClock() {\n return this.getContract().read.clock();\n }\n\n /**\n * Withdraw tokens to a recipient.\n *\n * @param recipient The recipient address.\n * @returns The transaction.\n */\n public withdraw(recipient: Address) {\n return this.getContract().write.withdraw([recipient], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Delegate votes to another address.\n *\n * @param delegatee The delegatee address.\n * @returns The transaction.\n */\n public delegate(delegatee: Address) {\n return this.getContract().write.delegate([delegatee], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n}\n"],"names":["VLPufferHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","ERC20PermitHandler","address","TOKENS_ADDRESSES","Token","abi","vlPUFFER","client","getContract","account","owner","spender","from","to","value","user","pufferAmount","unlockTime","timepoint","delegatee","nonce","expiry","v","r","amount","multiplier","pos","permitData","isPreapproved","recipient"],"mappings":";;;;;;;;AAoBO,MAAMA,EAAgB;AAAA;AAAA;AAAA;AAAA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KAAK,aAAa;AAAA,QAC3B,OAAO,KAAK;AAAA,MAAA;AAAA,IAEhB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQK,WAAW;AAChB,WAAO,KAAK,cAAc,KAAK,MAAM;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAShC,SAASE,GAAoB;AAClC,WAAO,KAAK,YAAY,EAAE,MAAM,SAAS,CAACA,CAAS,GAAG;AAAA,MACpD,SAAS,KAAK,aAAa;AAAA,MAC3B,OAAO,KAAK;AAAA,IAAA,CACb;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASI,SAASV,GAAoB;AAClC,WAAO,KAAK,YAAY,EAAE,MAAM,SAAS,CAACA,CAAS,GAAG;AAAA,MACpD,SAAS,KAAK,aAAa;AAAA,MAC3B,OAAO,KAAK;AAAA,IAAA,CACb;AAAA,EAAA;AAEL;"}
1
+ {"version":3,"file":"vl-puffer-handler.js","sources":["../../../lib/contracts/handlers/vl-puffer-handler.ts"],"sourcesContent":["import {\n Address,\n GetContractReturnType,\n PublicClient,\n Chain as ViemChain,\n WalletClient,\n getContract,\n Account,\n Hex,\n} from 'viem';\nimport { Chain, VIEM_CHAINS } from '../../chains/constants';\nimport { vlPUFFER } from '../abis/mainnet/vlPUFFER';\nimport { ERC20PermitHandler } from './erc20-permit-handler';\nimport { Token, TOKENS_ADDRESSES } from '../tokens';\nimport { PermitData } from '../common/lib/types';\n\n/**\n * Handler for the `vlPUFFER` contract exposing methods to interact\n * with the contract.\n */\nexport class VLPufferHandler {\n private viemChain: ViemChain;\n private erc20PermitHandler: ERC20PermitHandler;\n\n /**\n * Create the handler for the `vlPUFFER` contract exposing methods to\n * interact with the contract.\n *\n * @param chain Chain to use for the client.\n * @param walletClient The wallet client to use for wallet\n * interactions.\n * @param publicClient The public client to use for public\n * interactions.\n */\n constructor(\n private chain: Chain,\n private walletClient: WalletClient,\n private publicClient: PublicClient,\n ) {\n this.viemChain = VIEM_CHAINS[chain];\n this.erc20PermitHandler = new ERC20PermitHandler(\n chain,\n walletClient,\n publicClient,\n );\n }\n\n /**\n * Get the contract.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = TOKENS_ADDRESSES[Token.vlPUFFER][this.chain] as Address;\n const abi = vlPUFFER;\n const client = { public: this.publicClient, wallet: this.walletClient };\n\n return getContract({ address, abi, client }) as GetContractReturnType<\n typeof vlPUFFER,\n typeof client,\n Address\n >;\n }\n\n /**\n * Get the PUFFER token address.\n *\n * @returns The PUFFER token address.\n */\n public PUFFER() {\n return this.getContract().read.PUFFER();\n }\n\n /**\n * Get the decimals of the token.\n *\n * @returns The decimals.\n */\n public decimals() {\n return this.getContract().read.decimals();\n }\n\n /**\n * Get the delegates for an account.\n *\n * @param account The account to get delegates for.\n * @returns The delegate address.\n */\n public delegates(account: Address) {\n return this.getContract().read.delegates([account]);\n }\n\n /**\n * Get the owner of the contract.\n *\n * @returns The owner address.\n */\n public owner() {\n return this.getContract().read.owner();\n }\n\n /**\n * Get the allowance of the owner for the spender.\n *\n * @param owner The owner of the allowance.\n * @param spender The spender of the allowance.\n * @returns The allowance.\n */\n public allowance(owner: Address, spender: Address) {\n return this.getContract().read.allowance([owner, spender]);\n }\n\n /**\n * Transfer tokens from one address to another.\n *\n * @param from The address to transfer from.\n * @param to The address to transfer to.\n * @param value The amount to transfer.\n * @returns The transaction.\n */\n public transferFrom(from: Address, to: Address, value: bigint) {\n return this.getContract().write.transferFrom([from, to, value], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the total supply of the token.\n *\n * @returns The total supply.\n */\n public totalSupply() {\n return this.getContract().read.totalSupply();\n }\n\n /**\n * Get the symbol of the token.\n *\n * @returns The symbol.\n */\n public symbol() {\n return this.getContract().read.symbol();\n }\n\n /**\n * Check if the contract is paused.\n *\n * @returns True if paused, false otherwise.\n */\n public isPaused() {\n return this.getContract().read.paused();\n }\n\n /**\n * Get the lock information for a user.\n *\n * @param user The user address.\n * @returns The lock information.\n */\n public async lockInfos(user: Address) {\n const [pufferAmount, unlockTime] = await this.getContract().read.lockInfos([\n user,\n ]);\n\n return { pufferAmount, unlockTime };\n }\n\n /**\n * Get the past total supply at a specific timepoint.\n *\n * @param timepoint The timepoint to get the total supply for.\n * @returns The past total supply.\n */\n public getPastTotalSupply(timepoint: bigint) {\n return this.getContract().read.getPastTotalSupply([timepoint]);\n }\n\n /**\n * Get the balance for an address.\n *\n * @param account The address to get the balance of.\n * @returns The balance.\n */\n public balanceOf(account: Address) {\n return this.getContract().read.balanceOf([account]);\n }\n\n /**\n * Get the nonce for an owner.\n *\n * @param owner The owner address.\n * @returns The nonce.\n */\n public nonces(owner: Address) {\n return this.getContract().read.nonces([owner]);\n }\n\n /**\n * Get the votes for an account.\n *\n * @param account The account to get votes for.\n * @returns The votes.\n */\n public votes(account: Address) {\n return this.getContract().read.getVotes([account]);\n }\n\n /**\n * Delegate by signature.\n *\n * @param delegatee The delegatee address.\n * @param nonce The nonce.\n * @param expiry The expiry time.\n * @param v The v component of the signature.\n * @param r The r component of the signature.\n * @param s The s component of the signature.\n * @returns The transaction.\n */\n public delegateBySig(\n delegatee: Address,\n nonce: bigint,\n expiry: bigint,\n v: number,\n r: Hex,\n s: Hex,\n ) {\n return this.getContract().write.delegateBySig(\n [delegatee, nonce, expiry, v, r, s],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Delegate votes to another address.\n *\n * @param delegatee The delegatee address.\n * @returns The transaction.\n */\n public delegatePreapproved(delegatee: Address) {\n return this.getContract().write.delegate([delegatee], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Delegate votes to another address.\n *\n * @param delegatee The delegatee address.\n * @param isPreapproved Whether the PUFFER token is preapproved or\n * should use a permit signature.\n * @returns The transaction.\n */\n public async delegate(delegatee: Address, isPreapproved: boolean) {\n if (isPreapproved) {\n return this.delegatePreapproved(delegatee);\n }\n\n const account = this.walletClient.account as Account;\n // Internally create a permit signature for the PUFFER token.\n const permitHandler = this.erc20PermitHandler.withToken(Token.PUFFER);\n const { r, s, v, deadline } = await permitHandler.getPermitData(\n account.address,\n this.getContract().address,\n 0n,\n );\n const nonces = await permitHandler.nonces(account.address);\n\n return this.delegateBySig(delegatee, nonces, deadline, v, r, s);\n }\n\n /**\n * Transfer tokens to another address.\n *\n * @param to The address to transfer to.\n * @param value The amount to transfer.\n * @returns The transaction.\n */\n public transfer(to: Address, value: bigint) {\n return this.getContract().write.transfer([to, value], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the clock mode.\n *\n * @returns The clock mode.\n */\n public getClockMode() {\n return this.getContract().read.CLOCK_MODE();\n }\n\n /**\n * Get the number of checkpoints for an account.\n *\n * @param account The account to get checkpoints for.\n * @returns The number of checkpoints.\n */\n public numCheckpoints(account: Address) {\n return this.getContract().read.numCheckpoints([account]);\n }\n\n /**\n * Approve a spender to spend tokens.\n *\n * @param spender The spender address.\n * @param value The amount to approve.\n * @returns The transaction.\n */\n public approve(spender: Address, value: bigint) {\n return this.getContract().write.approve([spender, value], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Re-lock with the specified amount and multiplier.\n *\n * @param amount The amount to re-lock.\n * @param multiplier The multiplier for the re-lock.\n * @returns The transaction.\n */\n public reLock(amount: bigint, multiplier: bigint) {\n return this.getContract().write.reLock([amount, multiplier], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the past votes for an account at a specific timepoint.\n *\n * @param account The account to get past votes for.\n * @param timepoint The timepoint to get votes for.\n * @returns The past votes.\n */\n public getPastVotes(account: Address, timepoint: bigint) {\n return this.getContract().read.getPastVotes([account, timepoint]);\n }\n\n /**\n * Get the checkpoints for an account at a specific position.\n *\n * @param account The account to get checkpoints for.\n * @param pos The position of the checkpoint.\n * @returns The checkpoint.\n */\n public checkpoints(account: Address, pos: number) {\n return this.getContract().read.checkpoints([account, pos]);\n }\n\n /**\n * Get the name of the token.\n *\n * @returns The name.\n */\n public name() {\n return this.getContract().read.name();\n }\n\n /**\n * Create a lock with the specified amount and multiplier.\n *\n * @param amount The amount to lock.\n * @param multiplier The multiplier for the lock.\n * @returns The transaction.\n */\n public createLock(amount: bigint, multiplier: bigint) {\n return this.getContract().write.createLock([amount, multiplier], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Create a lock with permit.\n *\n * @param value The amount to lock.\n * @param multiplier The multiplier for the lock.\n * @param permitData The permit data.\n * @returns The transaction.\n */\n public createLockWithPermit(\n value: bigint,\n multiplier: bigint,\n permitData: PermitData,\n ) {\n return this.getContract().write.createLockWithPermit(\n [value, multiplier, permitData],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Create a lock with permit.\n *\n * @param value The amount to lock.\n * @param multiplier The multiplier for the lock.\n * @param isPreapproved Whether the PUFFER token is preapproved.\n * @returns The transaction.\n */\n public async lock(value: bigint, multiplier: bigint, isPreapproved: boolean) {\n if (isPreapproved) {\n return this.createLock(value, multiplier);\n }\n\n const account = this.walletClient.account as Account;\n // Internally create a permit signature for the PUFFER token.\n const permitData = await this.erc20PermitHandler\n .withToken(Token.PUFFER)\n .getPermitData(account.address, this.getContract().address, value);\n\n // Create a lock with the permit data.\n return this.getContract().write.createLockWithPermit(\n [value, multiplier, permitData],\n {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n },\n );\n }\n\n /**\n * Get the current clock value.\n *\n * @returns The clock value.\n */\n public getClock() {\n return this.getContract().read.clock();\n }\n\n /**\n * Withdraw tokens to a recipient.\n *\n * @param recipient The recipient address.\n * @returns The transaction.\n */\n public withdraw(recipient: Address) {\n return this.getContract().write.withdraw([recipient], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n}\n"],"names":["VLPufferHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","ERC20PermitHandler","address","TOKENS_ADDRESSES","Token","abi","vlPUFFER","client","getContract","account","owner","spender","from","to","value","user","pufferAmount","unlockTime","timepoint","delegatee","nonce","expiry","v","r","s","isPreapproved","permitHandler","deadline","nonces","amount","multiplier","pos","permitData","recipient"],"mappings":";;;;;;;;AAoBO,MAAMA,EAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAc3B,YACUC,GACAC,GACAC,GACR;AAjBM,IAAAC,EAAA;AACA,IAAAA,EAAA;AAaE,SAAA,QAAAH,GACA,KAAA,eAAAC,GACA,KAAA,eAAAC,GAEH,KAAA,YAAYE,EAAYJ,CAAK,GAClC,KAAK,qBAAqB,IAAIK;AAAA,MAC5BL;AAAA,MACAC;AAAA,MACAC;AAAA,IACF;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQK,cAAc;AACnB,UAAMI,IAAUC,EAAiBC,EAAM,QAAQ,EAAE,KAAK,KAAK,GACrDC,IAAMC,GACNC,IAAS,EAAE,QAAQ,KAAK,cAAc,QAAQ,KAAK,aAAa;AAEtE,WAAOC,EAAY,EAAE,SAAAN,GAAS,KAAAG,GAAK,QAAAE,GAAQ;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYtC,SAAS;AACd,WAAO,KAAK,cAAc,KAAK,OAAO;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQjC,WAAW;AAChB,WAAO,KAAK,cAAc,KAAK,SAAS;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASnC,UAAUE,GAAkB;AACjC,WAAO,KAAK,YAAY,EAAE,KAAK,UAAU,CAACA,CAAO,CAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7C,QAAQ;AACb,WAAO,KAAK,cAAc,KAAK,MAAM;AAAA,EAAA;AAAA;AAAA;AAA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S,CAACA,CAAS,GAAG;AAAA,MACpD,SAAS,KAAK,aAAa;AAAA,MAC3B,OAAO,KAAK;AAAA,IAAA,CACb;AAAA,EAAA;AAEL;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../constants-CxSgz27h.cjs");var C=(e=>(e.USDT="USDT",e.USDC="USDC",e.DAI="DAI",e.WETH="WETH",e.stETH="stETH",e.wstETH="wstETH",e.eETH="eETH",e.cbETH="cbETH",e.ALT="ALT",e.pufETHwstE="pufETHwstE",e.pufETH="pufETH",e.xPufETH="xPufETH",e.ctTACpufETH="ctTACpufETH",e.tacpufETH="tacpufETH",e.WBTC="WBTC",e.LBTC="LBTC",e.tBTC="tBTC",e.cbBTC="cbBTC",e.pumpBTC="pumpBTC",e.SolvBTC="SolvBTC",e.PUFFER="PUFFER",e.vePUFFER="vePUFFER",e.CARROT="CARROT",e.lvlUSD="lvlUSD",e.slvlUSD="slvlUSD",e.mtwCARROT="mtwCARROT",e.sCARROT="sCARROT",e.LINK="LINK",e.TEST="TEST",e.VT="VT",e.EIGEN="EIGEN",e.ARPA="ARPA",e.vlPUFFER="vlPUFFER",e))(C||{}),i=(e=>(e.unifiETH="unifiETH",e.unifiUSD="unifiUSD",e.unifiBTC="unifiBTC",e.pufETHs="pufETHs",e))(i||{});const n={VT:{[a.Chain.Mainnet]:"0x7D26AD6F6BA9D6bA1de0218Ae5e20CD3a273a55A",[a.Chain.Holesky]:"0xB028194785178a94Fe608994A4d5AD84c285A640"},TEST:{[a.Chain.Sepolia]:"0xd26e3540a0a368845b234736a0700e0a5a821bba",[a.Chain.OptimismSepolia]:"0x7Fa13D6CB44164ea09dF8BCc673A8849092D435b"},LINK:{[a.Chain.BaseSepolia]:"0xe4ab69c077896252fafbd49efd26b5d171a32410",[a.Chain.OptimismSepolia]:"0xE4aB69C077896252FAFBD49EFD26B5D171A32410"},USDT:{[a.Chain.Mainnet]:"0xdac17f958d2ee523a2206206994597c13d831ec7",[a.Chain.Holesky]:"0xd5bef2c64f418fd460319521d37862327122e3bc",[a.Chain.Sepolia]:"0xaa8e23fb1079ea71e0a56f48a2aa51851d8433d0"},USDC:{[a.Chain.Mainnet]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[a.Chain.Holesky]:"0x64Cc0de0429bcb87e875905a0c313ec88f6d1d3E"},DAI:{[a.Chain.Mainnet]:"0x6b175474e89094c44da98b954eedeac495271d0f",[a.Chain.Holesky]:"0x4478905505ddfb7eA1c8A9f46eAEC3695cE542ac"},WETH:{[a.Chain.Mainnet]:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",[a.Chain.Holesky]:"0x1d181cBd1825e9eBC6AD966878D555A7215FF4F0",[a.Chain.Hoodi]:"0x251609d3e04165CA5CfaBa5DEE70A4e47863D060"},stETH:{[a.Chain.Mainnet]:"0xae7ab96520de3a18e5e111b5eaab095312d7fe84",[a.Chain.Holesky]:"0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034"},wstETH:{[a.Chain.Mainnet]:"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",[a.Chain.Holesky]:"0x8d09a4502Cc8Cf1547aD300E066060D043f6982D"},eETH:{[a.Chain.Mainnet]:"0x35fa164735182de50811e8e2e824cfb9b6118ac2",[a.Chain.Holesky]:"0x7ba2ee123b5977e3da040e1eacb3a61c82c17876"},cbETH:{[a.Chain.Mainnet]:"0xbe9895146f7af43049ca1c1ae358b0541ea49704",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},ALT:{[a.Chain.Mainnet]:"0x8457ca5040ad67fdebbcc8edce889a335bc0fbfb",[a.Chain.Holesky]:"0xaf5588a571b42c7e50bd440d80f9bf94a4db94ee"},pufETHwstE:{[a.Chain.Mainnet]:"0xeeda34a377dd0ca676b9511ee1324974fa8d980d",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},pufETH:{[a.Chain.Mainnet]:"0xd9a442856c234a39a81a089c06451ebaa4306a72",[a.Chain.Holesky]:"0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9",[a.Chain.Soneium]:"0x6c460b2c6D6719562D5dA43E5152B375e79B9A8B",[a.Chain.Arbitrum]:"0x37D6382B6889cCeF8d6871A8b60E667115eDDBcF",[a.Chain.Berachain]:"0x417b0Ff8358Eb72867Da92225CaB99BCD5e6F205",[a.Chain.TAC]:"0x37D6382B6889cCeF8d6871A8b60E667115eDDBcF"},xPufETH:{[a.Chain.Mainnet]:"0xD7D2802f6b19843ac4DfE25022771FD83b5A7464",[a.Chain.Base]:"0x23dA5F2d509cb43A59d43C108a43eDf34510eff1",[a.Chain.Bsc]:"0x64274835D88F5c0215da8AADd9A5f2D2A2569381",[a.Chain.ApeChain]:"0x6234E5ef39B12EFdFcbd99dd7F452F27F3fEAE3b",[a.Chain.Zircuit]:"0x9346A5043C590133FE900aec643D9622EDddBA57"},ctTACpufETH:{[a.Chain.Mainnet]:"0x78f314241df1ac151bfd0413eeb51979515f6abd",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},tacpufETH:{[a.Chain.Mainnet]:"0xf2e97704a567e003ed97f2d0976c45b2dda766a0",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},WBTC:{[a.Chain.Mainnet]:"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},LBTC:{[a.Chain.Mainnet]:"0x8236a87084f8b84306f72007f36f2618a5634494",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},tBTC:{[a.Chain.Mainnet]:"0x18084fbA666a33d37592fA2633fD49a74DD93a88",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},cbBTC:{[a.Chain.Mainnet]:"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},pumpBTC:{[a.Chain.Mainnet]:"0xf469fbd2abcd6b9de8e169d128226c0fc90a012e",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},SolvBTC:{[a.Chain.Mainnet]:"0x7a56e1c57c7475ccf742a1832b028f0456652f97",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},PUFFER:{[a.Chain.Mainnet]:"0x4d1c297d39c5c1277964d0e3f8aa901493664530",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},vePUFFER:{[a.Chain.Mainnet]:"0xA55eD5808aeCDF23AE3782C1443185f5D2363ce7"},CARROT:{[a.Chain.Mainnet]:"0x282a69142bac47855c3fbe1693fcc4ba3b4d5ed6",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},lvlUSD:{[a.Chain.Mainnet]:"0x7C1156E515aA1A2E851674120074968C905aAF37",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},slvlUSD:{[a.Chain.Mainnet]:"0x4737d9b4592b40d51e110b94c9c043c6654067ae",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},mtwCARROT:{[a.Chain.Mainnet]:"0x8A5A5DE9db5770123Ff2145F59e9F20047f0A8EC",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},sCARROT:{[a.Chain.Mainnet]:"0x99c599227c65132822f0290d9e5b4b0430d6c0d6",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},EIGEN:{[a.Chain.Mainnet]:"0xec53bF9167f50cDEB3Ae105f56099aaaB9061F83"},ARPA:{[a.Chain.Mainnet]:"0xBA50933C268F567BDC86E1aC131BE072C6B0b71a"},unifiETH:{[a.Chain.Mainnet]:"0x196ead472583bc1e9af7a05f860d9857e1bd3dcc",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},unifiUSD:{[a.Chain.Mainnet]:"0x82c40e07277eBb92935f79cE92268F80dDc7caB4",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},unifiBTC:{[a.Chain.Mainnet]:"0x170d847a8320f3b6a77ee15b0cae430e3ec933a0",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},pufETHs:{[a.Chain.Mainnet]:"0x62a4ce0722ee65635c0f8339dd814d549b6f6735",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},vlPUFFER:{[a.Chain.Mainnet]:"0xe4c36adb90e936041776ddb87851ec38affd1499"}},c={USDT:"",USDC:"",DAI:"",WETH:"",stETH:"2",wstETH:"1",eETH:"1",cbETH:"2",ALT:"1",pufETHwstE:"v7.0.0",pufETH:"1",xPufETH:"1",ctTACpufETH:"",tacpufETH:"v0.5.0",WBTC:"",LBTC:"",tBTC:"",cbBTC:"",pumpBTC:"",SolvBTC:"",PUFFER:"1",vePUFFER:"1",CARROT:"1",lvlUSD:"1",slvlUSD:"",mtwCARROT:"",sCARROT:"",LINK:"",TEST:"",VT:"1",EIGEN:"1",ARPA:"1",unifiETH:"1",unifiUSD:"1",unifiBTC:"1",pufETHs:"1",vlPUFFER:"1"},f={pufETHwstE:{[a.Chain.Mainnet]:"0x0e986ed5610121905f03fd3850cebcc00f66166fc3ab760acb4e087d735d9457",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000000000000000000000000000"}};exports.TOKENS_ADDRESSES=n;exports.TOKENS_PERMIT_VERSION=c;exports.TOKENS_SALT=f;exports.Token=C;exports.UnifiToken=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../constants-CxSgz27h.cjs");var C=(e=>(e.USDT="USDT",e.USDC="USDC",e.DAI="DAI",e.WETH="WETH",e.stETH="stETH",e.wstETH="wstETH",e.eETH="eETH",e.cbETH="cbETH",e.ALT="ALT",e.pufETHwstE="pufETHwstE",e.pufETH="pufETH",e.xPufETH="xPufETH",e.ctTACpufETH="ctTACpufETH",e.tacpufETH="tacpufETH",e.WBTC="WBTC",e.LBTC="LBTC",e.tBTC="tBTC",e.cbBTC="cbBTC",e.pumpBTC="pumpBTC",e.SolvBTC="SolvBTC",e.PUFFER="PUFFER",e.vePUFFER="vePUFFER",e.CARROT="CARROT",e.lvlUSD="lvlUSD",e.slvlUSD="slvlUSD",e.mtwCARROT="mtwCARROT",e.sCARROT="sCARROT",e.LINK="LINK",e.TEST="TEST",e.VT="VT",e.EIGEN="EIGEN",e.ARPA="ARPA",e.vlPUFFER="vlPUFFER",e))(C||{}),i=(e=>(e.unifiETH="unifiETH",e.unifiUSD="unifiUSD",e.unifiBTC="unifiBTC",e.pufETHs="pufETHs",e))(i||{});const n={VT:{[a.Chain.Mainnet]:"0x7D26AD6F6BA9D6bA1de0218Ae5e20CD3a273a55A",[a.Chain.Holesky]:"0xB028194785178a94Fe608994A4d5AD84c285A640"},TEST:{[a.Chain.Sepolia]:"0xd26e3540a0a368845b234736a0700e0a5a821bba",[a.Chain.OptimismSepolia]:"0x7Fa13D6CB44164ea09dF8BCc673A8849092D435b"},LINK:{[a.Chain.BaseSepolia]:"0xe4ab69c077896252fafbd49efd26b5d171a32410",[a.Chain.OptimismSepolia]:"0xE4aB69C077896252FAFBD49EFD26B5D171A32410"},USDT:{[a.Chain.Mainnet]:"0xdac17f958d2ee523a2206206994597c13d831ec7",[a.Chain.Holesky]:"0xd5bef2c64f418fd460319521d37862327122e3bc",[a.Chain.Sepolia]:"0xaa8e23fb1079ea71e0a56f48a2aa51851d8433d0"},USDC:{[a.Chain.Mainnet]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[a.Chain.Holesky]:"0x64Cc0de0429bcb87e875905a0c313ec88f6d1d3E"},DAI:{[a.Chain.Mainnet]:"0x6b175474e89094c44da98b954eedeac495271d0f",[a.Chain.Holesky]:"0x4478905505ddfb7eA1c8A9f46eAEC3695cE542ac"},WETH:{[a.Chain.Mainnet]:"0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",[a.Chain.Holesky]:"0x1d181cBd1825e9eBC6AD966878D555A7215FF4F0",[a.Chain.Hoodi]:"0x251609d3e04165CA5CfaBa5DEE70A4e47863D060"},stETH:{[a.Chain.Mainnet]:"0xae7ab96520de3a18e5e111b5eaab095312d7fe84",[a.Chain.Holesky]:"0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034"},wstETH:{[a.Chain.Mainnet]:"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",[a.Chain.Holesky]:"0x8d09a4502Cc8Cf1547aD300E066060D043f6982D"},eETH:{[a.Chain.Mainnet]:"0x35fa164735182de50811e8e2e824cfb9b6118ac2",[a.Chain.Holesky]:"0x7ba2ee123b5977e3da040e1eacb3a61c82c17876"},cbETH:{[a.Chain.Mainnet]:"0xbe9895146f7af43049ca1c1ae358b0541ea49704",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},ALT:{[a.Chain.Mainnet]:"0x8457ca5040ad67fdebbcc8edce889a335bc0fbfb",[a.Chain.Holesky]:"0xaf5588a571b42c7e50bd440d80f9bf94a4db94ee"},pufETHwstE:{[a.Chain.Mainnet]:"0xeeda34a377dd0ca676b9511ee1324974fa8d980d",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},pufETH:{[a.Chain.Mainnet]:"0xd9a442856c234a39a81a089c06451ebaa4306a72",[a.Chain.Holesky]:"0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9",[a.Chain.Soneium]:"0x6c460b2c6D6719562D5dA43E5152B375e79B9A8B",[a.Chain.Arbitrum]:"0x37D6382B6889cCeF8d6871A8b60E667115eDDBcF",[a.Chain.Berachain]:"0x417b0Ff8358Eb72867Da92225CaB99BCD5e6F205",[a.Chain.TAC]:"0x37D6382B6889cCeF8d6871A8b60E667115eDDBcF"},xPufETH:{[a.Chain.Mainnet]:"0xD7D2802f6b19843ac4DfE25022771FD83b5A7464",[a.Chain.Base]:"0x23dA5F2d509cb43A59d43C108a43eDf34510eff1",[a.Chain.Bsc]:"0x64274835D88F5c0215da8AADd9A5f2D2A2569381",[a.Chain.ApeChain]:"0x6234E5ef39B12EFdFcbd99dd7F452F27F3fEAE3b",[a.Chain.Zircuit]:"0x9346A5043C590133FE900aec643D9622EDddBA57"},ctTACpufETH:{[a.Chain.Mainnet]:"0x78f314241df1ac151bfd0413eeb51979515f6abd",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},tacpufETH:{[a.Chain.Mainnet]:"0xf2e97704a567e003ed97f2d0976c45b2dda766a0",[a.Chain.TAC]:"0x85AF3C2755f17bA26D7326E8069Bf10719441068",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},WBTC:{[a.Chain.Mainnet]:"0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},LBTC:{[a.Chain.Mainnet]:"0x8236a87084f8b84306f72007f36f2618a5634494",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},tBTC:{[a.Chain.Mainnet]:"0x18084fbA666a33d37592fA2633fD49a74DD93a88",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},cbBTC:{[a.Chain.Mainnet]:"0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},pumpBTC:{[a.Chain.Mainnet]:"0xf469fbd2abcd6b9de8e169d128226c0fc90a012e",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},SolvBTC:{[a.Chain.Mainnet]:"0x7a56e1c57c7475ccf742a1832b028f0456652f97",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},PUFFER:{[a.Chain.Mainnet]:"0x4d1c297d39c5c1277964d0e3f8aa901493664530",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},vePUFFER:{[a.Chain.Mainnet]:"0xA55eD5808aeCDF23AE3782C1443185f5D2363ce7"},CARROT:{[a.Chain.Mainnet]:"0x282a69142bac47855c3fbe1693fcc4ba3b4d5ed6",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},lvlUSD:{[a.Chain.Mainnet]:"0x7C1156E515aA1A2E851674120074968C905aAF37",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},slvlUSD:{[a.Chain.Mainnet]:"0x4737d9b4592b40d51e110b94c9c043c6654067ae",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},mtwCARROT:{[a.Chain.Mainnet]:"0x8A5A5DE9db5770123Ff2145F59e9F20047f0A8EC",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},sCARROT:{[a.Chain.Mainnet]:"0x99c599227c65132822f0290d9e5b4b0430d6c0d6",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},EIGEN:{[a.Chain.Mainnet]:"0xec53bF9167f50cDEB3Ae105f56099aaaB9061F83"},ARPA:{[a.Chain.Mainnet]:"0xBA50933C268F567BDC86E1aC131BE072C6B0b71a"},unifiETH:{[a.Chain.Mainnet]:"0x196ead472583bc1e9af7a05f860d9857e1bd3dcc",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},unifiUSD:{[a.Chain.Mainnet]:"0x82c40e07277eBb92935f79cE92268F80dDc7caB4",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},unifiBTC:{[a.Chain.Mainnet]:"0x170d847a8320f3b6a77ee15b0cae430e3ec933a0",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},pufETHs:{[a.Chain.Mainnet]:"0x62a4ce0722ee65635c0f8339dd814d549b6f6735",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},vlPUFFER:{[a.Chain.Mainnet]:"0xe4c36adb90e936041776ddb87851ec38affd1499"}},c={USDT:"",USDC:"",DAI:"",WETH:"",stETH:"2",wstETH:"1",eETH:"1",cbETH:"2",ALT:"1",pufETHwstE:"v7.0.0",pufETH:"1",xPufETH:"1",ctTACpufETH:"",tacpufETH:"v0.5.0",WBTC:"",LBTC:"",tBTC:"",cbBTC:"",pumpBTC:"",SolvBTC:"",PUFFER:"1",vePUFFER:"1",CARROT:"1",lvlUSD:"1",slvlUSD:"",mtwCARROT:"",sCARROT:"",LINK:"",TEST:"",VT:"1",EIGEN:"1",ARPA:"1",unifiETH:"1",unifiUSD:"1",unifiBTC:"1",pufETHs:"1",vlPUFFER:"1"},f={pufETHwstE:{[a.Chain.Mainnet]:"0x0e986ed5610121905f03fd3850cebcc00f66166fc3ab760acb4e087d735d9457",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000000000000000000000000000"}};exports.TOKENS_ADDRESSES=n;exports.TOKENS_PERMIT_VERSION=c;exports.TOKENS_SALT=f;exports.Token=C;exports.UnifiToken=i;
2
2
  //# sourceMappingURL=tokens.cjs.map