@pufferfinance/puffer-sdk 1.9.1 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/contracts/addresses.cjs +1 -1
  2. package/dist/contracts/addresses.cjs.map +1 -1
  3. package/dist/contracts/addresses.d.ts +26 -12
  4. package/dist/contracts/addresses.js +28 -11
  5. package/dist/contracts/addresses.js.map +1 -1
  6. package/dist/contracts/handlers/nucleus-accountant-handler.cjs +1 -1
  7. package/dist/contracts/handlers/nucleus-accountant-handler.cjs.map +1 -1
  8. package/dist/contracts/handlers/nucleus-accountant-handler.d.ts +10 -0
  9. package/dist/contracts/handlers/nucleus-accountant-handler.js +26 -11
  10. package/dist/contracts/handlers/nucleus-accountant-handler.js.map +1 -1
  11. package/dist/contracts/handlers/nucleus-atomic-queue-handler.cjs +1 -1
  12. package/dist/contracts/handlers/nucleus-atomic-queue-handler.cjs.map +1 -1
  13. package/dist/contracts/handlers/nucleus-atomic-queue-handler.js +3 -3
  14. package/dist/contracts/handlers/nucleus-atomic-queue-handler.js.map +1 -1
  15. package/dist/contracts/handlers/nucleus-boring-vault-handler.cjs +1 -1
  16. package/dist/contracts/handlers/nucleus-boring-vault-handler.cjs.map +1 -1
  17. package/dist/contracts/handlers/nucleus-boring-vault-handler.d.ts +10 -6
  18. package/dist/contracts/handlers/nucleus-boring-vault-handler.js +38 -34
  19. package/dist/contracts/handlers/nucleus-boring-vault-handler.js.map +1 -1
  20. package/dist/contracts/handlers/nucleus-teller-handler.cjs +1 -1
  21. package/dist/contracts/handlers/nucleus-teller-handler.cjs.map +1 -1
  22. package/dist/contracts/handlers/nucleus-teller-handler.d.ts +9 -0
  23. package/dist/contracts/handlers/nucleus-teller-handler.js +30 -19
  24. package/dist/contracts/handlers/nucleus-teller-handler.js.map +1 -1
  25. package/dist/contracts/tokens.cjs +1 -1
  26. package/dist/contracts/tokens.cjs.map +1 -1
  27. package/dist/contracts/tokens.d.ts +8 -2
  28. package/dist/contracts/tokens.js +39 -9
  29. package/dist/contracts/tokens.js.map +1 -1
  30. package/dist/main.cjs +1 -1
  31. package/dist/main.js +23 -22
  32. package/dist/utils/version.cjs +1 -1
  33. package/dist/utils/version.js +1 -1
  34. package/package.json +1 -1
@@ -1,11 +1,12 @@
1
1
  var u = Object.defineProperty;
2
- var m = (n, t, a) => t in n ? u(n, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[t] = a;
3
- var l = (n, t, a) => m(n, typeof t != "symbol" ? t + "" : t, a);
2
+ var l = (e, t, n) => t in e ? u(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var c = (e, t, n) => l(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { V as C } from "../../constants-BjRNQpT2.js";
5
5
  import { NUCLEUS_BORING_VAULT_ABIS as p } from "../abis/nucleus-boring-vault-abis.js";
6
- import { CONTRACT_ADDRESSES as g } from "../addresses.js";
7
- import { g as f } from "../../getContract-CezEyDf-.js";
8
- class _ {
6
+ import { NUCLEUS_CONTRACT_ADDRESSES as g } from "../addresses.js";
7
+ import { UnifiToken as f } from "../tokens.js";
8
+ import { g as w } from "../../getContract-CezEyDf-.js";
9
+ class V {
9
10
  /**
10
11
  * Create the handler for processing UniFi tokens.
11
12
  *
@@ -15,9 +16,20 @@ class _ {
15
16
  * @param publicClient The public client to use for public
16
17
  * interactions.
17
18
  */
18
- constructor(t, a, e) {
19
- l(this, "viemChain");
20
- this.chain = t, this.walletClient = a, this.publicClient = e, this.viemChain = C[t];
19
+ constructor(t, n, a) {
20
+ c(this, "viemChain");
21
+ c(this, "token");
22
+ this.chain = t, this.walletClient = n, this.publicClient = a, this.viemChain = C[t], this.token = f.unifiETH;
23
+ }
24
+ /**
25
+ * Set the UniFi token to use for executing transactions on the
26
+ * contract.
27
+ *
28
+ * @param token UniFi token to use for the handler.
29
+ * @returns The handler.
30
+ */
31
+ withToken(t) {
32
+ return this.token = t, this;
21
33
  }
22
34
  /**
23
35
  * Get the contract. This is a method because the typings are complex
@@ -26,8 +38,8 @@ class _ {
26
38
  * @returns The viem contract.
27
39
  */
28
40
  getContract() {
29
- const t = g[this.chain].NucleusBoringVault, a = p[this.chain].BoringVault, e = { public: this.publicClient, wallet: this.walletClient };
30
- return f({ address: t, abi: a, client: e });
41
+ const t = g[this.token][this.chain].NucleusBoringVault, n = p[this.chain].BoringVault, a = { public: this.publicClient, wallet: this.walletClient };
42
+ return w({ address: t, abi: n, client: a });
31
43
  }
32
44
  /**
33
45
  * Get the allowance for the given owner and spender.
@@ -36,16 +48,8 @@ class _ {
36
48
  * @param spender Address of the spender.
37
49
  * @returns Allowance for the given owner and spender.
38
50
  */
39
- getAllowance(t, a) {
40
- return this.getContract().read.allowance([t, a]);
41
- }
42
- /**
43
- * Get the total supply of the token.
44
- *
45
- * @returns Total supply of the token.
46
- */
47
- getTotalSupply() {
48
- return this.getContract().read.totalSupply();
51
+ getAllowance(t, n) {
52
+ return this.getContract().read.allowance([t, n]);
49
53
  }
50
54
  /**
51
55
  * Check the token balance of the wallet.
@@ -72,8 +76,8 @@ class _ {
72
76
  * @param value Value to approve for the spender.
73
77
  * @returns Hash of the transaction.
74
78
  */
75
- approve(t, a, e) {
76
- return this.getContract().write.approve([a, e], {
79
+ approve(t, n, a) {
80
+ return this.getContract().write.approve([n, a], {
77
81
  account: t,
78
82
  chain: this.viemChain
79
83
  });
@@ -90,11 +94,11 @@ class _ {
90
94
  * `estimate: () => Promise<bigint>` - Gas estimate of the
91
95
  * transaction.
92
96
  */
93
- transfer(t, a, e) {
94
- return { transact: () => this.getContract().write.transfer([a, e], {
97
+ transfer(t, n, a) {
98
+ return { transact: () => this.getContract().write.transfer([n, a], {
95
99
  account: t,
96
100
  chain: this.viemChain
97
- }), estimate: () => this.getContract().estimateGas.transfer([a, e], {
101
+ }), estimate: () => this.getContract().estimateGas.transfer([n, a], {
98
102
  account: t
99
103
  }) };
100
104
  }
@@ -111,12 +115,12 @@ class _ {
111
115
  * `estimate: () => Promise<bigint>` - Gas estimate of the
112
116
  * transaction.
113
117
  */
114
- transferFrom(t, a, e, r) {
115
- return { transact: () => this.getContract().write.transferFrom([a, e, r], {
118
+ transferFrom(t, n, a, i) {
119
+ return { transact: () => this.getContract().write.transferFrom([n, a, i], {
116
120
  account: t,
117
121
  chain: this.viemChain
118
122
  }), estimate: () => this.getContract().estimateGas.transferFrom(
119
- [a, e, r],
123
+ [n, a, i],
120
124
  { account: t }
121
125
  ) };
122
126
  }
@@ -139,17 +143,17 @@ class _ {
139
143
  * transaction.
140
144
  */
141
145
  permit(t) {
142
- const { account: a, owner: e, spender: r, value: i, deadline: c, v: s, r: o, s: h } = t;
146
+ const { account: n, owner: a, spender: i, value: r, deadline: s, v: o, r: h, s: m } = t;
143
147
  return { transact: () => this.getContract().write.permit(
144
- [e, r, i, c, s, o, h],
145
- { account: a, chain: this.viemChain }
148
+ [a, i, r, s, o, h, m],
149
+ { account: n, chain: this.viemChain }
146
150
  ), estimate: () => this.getContract().estimateGas.permit(
147
- [e, r, i, c, s, o, h],
148
- { account: a }
151
+ [a, i, r, s, o, h, m],
152
+ { account: n }
149
153
  ) };
150
154
  }
151
155
  }
152
156
  export {
153
- _ as NucleusBoringVaultHandler
157
+ V as NucleusBoringVaultHandler
154
158
  };
155
159
  //# sourceMappingURL=nucleus-boring-vault-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nucleus-boring-vault-handler.js","sources":["../../../lib/contracts/handlers/nucleus-boring-vault-handler.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport {\n WalletClient,\n PublicClient,\n getContract,\n Address,\n GetContractReturnType,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport { NUCLEUS_BORING_VAULT_ABIS } from '../abis/nucleus-boring-vault-abis';\nimport { CONTRACT_ADDRESSES } from '../addresses';\n\nexport type PermitParams = {\n account: Address;\n owner: Address;\n spender: Address;\n value: bigint;\n deadline: bigint;\n v: number;\n r: Address;\n s: Address;\n};\n\n/**\n * Handler for the `BoringVault` contract for a given token exposing\n * methods to interact with the contract.\n */\nexport class NucleusBoringVaultHandler {\n private viemChain: ViemChain;\n\n /**\n * Create the handler for processing UniFi tokens.\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]\n .NucleusBoringVault as Address;\n const abi = NUCLEUS_BORING_VAULT_ABIS[this.chain].BoringVault;\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 * Get the allowance for the given owner and spender.\n *\n * @param owner Address of the owner.\n * @param spender Address of the spender.\n * @returns Allowance for the given owner and spender.\n */\n public getAllowance(owner: Address, spender: Address) {\n return this.getContract().read.allowance([owner, spender]);\n }\n\n /**\n * Get the total supply of the token.\n *\n * @returns Total supply of the token.\n */\n public getTotalSupply() {\n return this.getContract().read.totalSupply();\n }\n\n /**\n * Check the token balance of the wallet.\n *\n * @param walletAddress Wallet address to check the balance of.\n * @returns Token balance in wei.\n */\n public balanceOf(walletAddress: Address) {\n return this.getContract().read.balanceOf([walletAddress]);\n }\n\n /**\n * Get the total supply of the token.\n *\n * @returns Total supply of the token.\n */\n public totalSupply() {\n return this.getContract().read.totalSupply();\n }\n\n /**\n * Approve transaction for the spender to spend the owner's tokens.\n *\n * @param walletAddress Address of the caller of the transaction.\n * @param spenderAddress Address of the spender.\n * @param value Value to approve for the spender.\n * @returns Hash of the transaction.\n */\n public approve(\n walletAddress: Address,\n spenderAddress: Address,\n value: bigint,\n ) {\n return this.getContract().write.approve([spenderAddress, value], {\n account: walletAddress,\n chain: this.viemChain,\n });\n }\n\n /**\n * Transfer tokens from the owner's wallet to the given address.\n *\n * @param walletAddress Address of the owner's wallet.\n * @param toAddress Address to transfer the tokens to.\n * @param value Value to transfer.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public transfer(walletAddress: Address, toAddress: Address, value: bigint) {\n const transact = () =>\n this.getContract().write.transfer([toAddress, value], {\n account: walletAddress,\n chain: this.viemChain,\n });\n const estimate = () =>\n this.getContract().estimateGas.transfer([toAddress, value], {\n account: walletAddress,\n });\n\n return { transact, estimate };\n }\n\n /**\n * Transfer tokens from the given address to another address.\n *\n * @param walletAddress Address of the caller of the transaction.\n * @param fromAddress Address to transfer the tokens from.\n * @param toAddress Address to transfer the tokens to.\n * @param value Value to transfer.\n * @returns `transact: () => 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 transferFrom(\n walletAddress: Address,\n fromAddress: Address,\n toAddress: Address,\n value: bigint,\n ) {\n const transact = () =>\n this.getContract().write.transferFrom([fromAddress, toAddress, value], {\n account: walletAddress,\n chain: this.viemChain,\n });\n const estimate = () =>\n this.getContract().estimateGas.transferFrom(\n [fromAddress, toAddress, value],\n { account: walletAddress },\n );\n\n return { transact, estimate };\n }\n\n /**\n * Get permit to be able to use the token.\n *\n * @param params Permit parameters.\n * @param params.account Address of the caller of the transaction.\n * @param params.owner Address of the owner.\n * @param params.spender Address of the spender.\n * @param params.value Value to approve for the spender.\n * @param params.deadline Deadline for the permit.\n * @param params.v v value of the permit.\n * @param params.r r value of the permit.\n * @param params.s s value of the permit.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public permit(params: PermitParams) {\n const { account, owner, spender, value, deadline, v, r, s } = params;\n const transact = () =>\n this.getContract().write.permit(\n [owner, spender, value, deadline, v, r, s],\n { account, chain: this.viemChain },\n );\n const estimate = () =>\n this.getContract().estimateGas.permit(\n [owner, spender, value, deadline, v, r, s],\n { account },\n );\n\n return { transact, estimate };\n }\n}\n"],"names":["NucleusBoringVaultHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","address","CONTRACT_ADDRESSES","abi","NUCLEUS_BORING_VAULT_ABIS","client","getContract","owner","spender","walletAddress","spenderAddress","value","toAddress","fromAddress","params","account","deadline","v","r","s"],"mappings":";;;;;;;AA4BO,MAAMA,EAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYrC,YACUC,GACAC,GACAC,GACR;AAfM,IAAAC,EAAA;AAYE,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,EAC1C,oBACGC,IAAMC,EAA0B,KAAK,KAAK,EAAE,aAC5CC,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,EActC,aAAaE,GAAgBC,GAAkB;AAC7C,WAAA,KAAK,cAAc,KAAK,UAAU,CAACD,GAAOC,CAAO,CAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQpD,iBAAiB;AACtB,WAAO,KAAK,cAAc,KAAK,YAAY;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAStC,UAAUC,GAAwB;AACvC,WAAO,KAAK,YAAY,EAAE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AAAA;AAAA;AAAA;AAAA;AAAA,EAqBvB,OAAOK,GAAsB;AAC5B,UAAA,EAAE,SAAAC,GAAS,OAAAR,GAAO,SAAAC,GAAS,OAAAG,GAAO,UAAAK,GAAU,GAAAC,GAAG,GAAAC,GAAG,GAAAC,EAAA,IAAML;AAYvD,WAAA,EAAE,UAXQ,MACf,KAAK,cAAc,MAAM;AAAA,MACvB,CAACP,GAAOC,GAASG,GAAOK,GAAUC,GAAGC,GAAGC,CAAC;AAAA,MACzC,EAAE,SAAAJ,GAAS,OAAO,KAAK,UAAU;AAAA,IACnC,GAOiB,UANF,MACf,KAAK,cAAc,YAAY;AAAA,MAC7B,CAACR,GAAOC,GAASG,GAAOK,GAAUC,GAAGC,GAAGC,CAAC;AAAA,MACzC,EAAE,SAAAJ,EAAQ;AAAA,IACZ,EAE0B;AAAA,EAAA;AAEhC;"}
1
+ {"version":3,"file":"nucleus-boring-vault-handler.js","sources":["../../../lib/contracts/handlers/nucleus-boring-vault-handler.ts"],"sourcesContent":["/* istanbul ignore file */\n\nimport {\n WalletClient,\n PublicClient,\n getContract,\n Address,\n GetContractReturnType,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport { NUCLEUS_BORING_VAULT_ABIS } from '../abis/nucleus-boring-vault-abis';\nimport { NUCLEUS_CONTRACT_ADDRESSES } from '../addresses';\nimport { UnifiToken } from '../tokens';\n\nexport type PermitParams = {\n account: Address;\n owner: Address;\n spender: Address;\n value: bigint;\n deadline: bigint;\n v: number;\n r: Address;\n s: Address;\n};\n\n/**\n * Handler for the `BoringVault` contract for a given token exposing\n * methods to interact with the contract.\n */\nexport class NucleusBoringVaultHandler {\n private viemChain: ViemChain;\n private token: UnifiToken;\n\n /**\n * Create the handler for processing UniFi tokens.\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.token = UnifiToken.unifiETH;\n }\n\n /**\n * Set the UniFi token to use for executing transactions on the\n * contract.\n *\n * @param token UniFi token to use for the handler.\n * @returns The handler.\n */\n public withToken(token: UnifiToken) {\n this.token = token;\n return this;\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 = NUCLEUS_CONTRACT_ADDRESSES[this.token][this.chain]\n .NucleusBoringVault as Address;\n const abi = NUCLEUS_BORING_VAULT_ABIS[this.chain].BoringVault;\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 * Get the allowance for the given owner and spender.\n *\n * @param owner Address of the owner.\n * @param spender Address of the spender.\n * @returns Allowance for the given owner and spender.\n */\n public getAllowance(owner: Address, spender: Address) {\n return this.getContract().read.allowance([owner, spender]);\n }\n\n /**\n * Check the token balance of the wallet.\n *\n * @param walletAddress Wallet address to check the balance of.\n * @returns Token balance in wei.\n */\n public balanceOf(walletAddress: Address) {\n return this.getContract().read.balanceOf([walletAddress]);\n }\n\n /**\n * Get the total supply of the token.\n *\n * @returns Total supply of the token.\n */\n public totalSupply() {\n return this.getContract().read.totalSupply();\n }\n\n /**\n * Approve transaction for the spender to spend the owner's tokens.\n *\n * @param walletAddress Address of the caller of the transaction.\n * @param spenderAddress Address of the spender.\n * @param value Value to approve for the spender.\n * @returns Hash of the transaction.\n */\n public approve(\n walletAddress: Address,\n spenderAddress: Address,\n value: bigint,\n ) {\n return this.getContract().write.approve([spenderAddress, value], {\n account: walletAddress,\n chain: this.viemChain,\n });\n }\n\n /**\n * Transfer tokens from the owner's wallet to the given address.\n *\n * @param walletAddress Address of the owner's wallet.\n * @param toAddress Address to transfer the tokens to.\n * @param value Value to transfer.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public transfer(walletAddress: Address, toAddress: Address, value: bigint) {\n const transact = () =>\n this.getContract().write.transfer([toAddress, value], {\n account: walletAddress,\n chain: this.viemChain,\n });\n const estimate = () =>\n this.getContract().estimateGas.transfer([toAddress, value], {\n account: walletAddress,\n });\n\n return { transact, estimate };\n }\n\n /**\n * Transfer tokens from the given address to another address.\n *\n * @param walletAddress Address of the caller of the transaction.\n * @param fromAddress Address to transfer the tokens from.\n * @param toAddress Address to transfer the tokens to.\n * @param value Value to transfer.\n * @returns `transact: () => 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 transferFrom(\n walletAddress: Address,\n fromAddress: Address,\n toAddress: Address,\n value: bigint,\n ) {\n const transact = () =>\n this.getContract().write.transferFrom([fromAddress, toAddress, value], {\n account: walletAddress,\n chain: this.viemChain,\n });\n const estimate = () =>\n this.getContract().estimateGas.transferFrom(\n [fromAddress, toAddress, value],\n { account: walletAddress },\n );\n\n return { transact, estimate };\n }\n\n /**\n * Get permit to be able to use the token.\n *\n * @param params Permit parameters.\n * @param params.account Address of the caller of the transaction.\n * @param params.owner Address of the owner.\n * @param params.spender Address of the spender.\n * @param params.value Value to approve for the spender.\n * @param params.deadline Deadline for the permit.\n * @param params.v v value of the permit.\n * @param params.r r value of the permit.\n * @param params.s s value of the permit.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public permit(params: PermitParams) {\n const { account, owner, spender, value, deadline, v, r, s } = params;\n const transact = () =>\n this.getContract().write.permit(\n [owner, spender, value, deadline, v, r, s],\n { account, chain: this.viemChain },\n );\n const estimate = () =>\n this.getContract().estimateGas.permit(\n [owner, spender, value, deadline, v, r, s],\n { account },\n );\n\n return { transact, estimate };\n }\n}\n"],"names":["NucleusBoringVaultHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","UnifiToken","token","address","NUCLEUS_CONTRACT_ADDRESSES","abi","NUCLEUS_BORING_VAULT_ABIS","client","getContract","owner","spender","walletAddress","spenderAddress","value","toAddress","fromAddress","params","account","deadline","v","r","s"],"mappings":";;;;;;;;AA6BO,MAAMA,EAA0B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAarC,YACUC,GACAC,GACAC,GACR;AAhBM,IAAAC,EAAA;AACA,IAAAA,EAAA;AAYE,SAAA,QAAAH,GACA,KAAA,eAAAC,GACA,KAAA,eAAAC,GAEH,KAAA,YAAYE,EAAYJ,CAAK,GAClC,KAAK,QAAQK,EAAW;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUnB,UAAUC,GAAmB;AAClC,gBAAK,QAAQA,GACN;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASF,cAAc;AACnB,UAAMC,IAAUC,EAA2B,KAAK,KAAK,EAAE,KAAK,KAAK,EAC9D,oBACGC,IAAMC,EAA0B,KAAK,KAAK,EAAE,aAC5CC,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,EActC,aAAaE,GAAgBC,GAAkB;AAC7C,WAAA,KAAK,cAAc,KAAK,UAAU,CAACD,GAAOC,CAAO,CAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASpD,UAAUC,GAAwB;AACvC,WAAO,KAAK,YAAY,EAAE,KAAK,UAAU,CAACA,CAAa,CAAC;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQnD,cAAc;AACnB,WAAO,KAAK,cAAc,KAAK,YAAY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AAK,GAAU,GAAAC,GAAG,GAAAC,GAAG,GAAAC,EAAA,IAAML;AAYvD,WAAA,EAAE,UAXQ,MACf,KAAK,cAAc,MAAM;AAAA,MACvB,CAACP,GAAOC,GAASG,GAAOK,GAAUC,GAAGC,GAAGC,CAAC;AAAA,MACzC,EAAE,SAAAJ,GAAS,OAAO,KAAK,UAAU;AAAA,IACnC,GAOiB,UANF,MACf,KAAK,cAAc,YAAY;AAAA,MAC7B,CAACR,GAAOC,GAASG,GAAOK,GAAUC,GAAGC,GAAGC,CAAC;AAAA,MACzC,EAAE,SAAAJ,EAAQ;AAAA,IACZ,EAE0B;AAAA,EAAA;AAEhC;"}
@@ -1,2 +1,2 @@
1
- "use strict";var P=Object.defineProperty;var S=(n,t,e)=>t in n?P(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var u=(n,t,e)=>S(n,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../../constants-DA2xUb9r.cjs"),T=require("../addresses.cjs"),E=require("../abis/nucleus-teller-abis.cjs"),C=require("../tokens.cjs"),_=require("./erc20-permit-handler.cjs"),v=require("../../getContract-3QbyfZBF.cjs");class A{constructor(t,e,i){u(this,"viemChain");u(this,"erc20PermitHandler");this.chain=t,this.walletClient=e,this.publicClient=i,this.viemChain=p.VIEM_CHAINS[t],this.erc20PermitHandler=new _.ERC20PermitHandler(t,e,i)}getContract(){const t=T.CONTRACT_ADDRESSES[this.chain].NucleusTeller,e=E.NUCLEUS_TELLER_ABIS[this.chain].Teller,i={public:this.publicClient,wallet:this.walletClient};return v.getContract({address:t,abi:e,client:i})}accountant(){return this.getContract().read.accountant()}vault(){return this.getContract().read.vault()}shareLockPeriod(){return this.getContract().read.shareLockPeriod()}shareUnlockTime(t){return this.getContract().read.shareUnlockTime([t])}isPaused(){return this.getContract().read.isPaused()}async deposit(t){const{token:e,unifiToken:i,account:s,amount:r,minimumMint:a,isPreapproved:o=!1}=t,c=C.TOKENS_ADDRESSES[e][this.chain];if(o)return{transact:()=>this.getContract().write.deposit([c,r,a],{account:s,chain:this.viemChain}),estimate:()=>this.getContract().estimateGas.deposit([c,r,a],{account:s})};const{r:h,s:l,v:d,deadline:g}=await this.erc20PermitHandler.withToken(e).getPermitSignature(s,C.TOKENS_ADDRESSES[i][this.chain],r),m=[c,r,a,g,Number(d),h,l];return{transact:()=>this.getContract().write.depositWithPermit(m,{account:s,chain:this.viemChain}),estimate:()=>this.getContract().estimateGas.depositWithPermit(m,{account:s})}}depositWithPermit(t){const{account:e,depositAsset:i,depositAmount:s,minimumMint:r,deadline:a,v:o,r:c,s:h}=t;return{transact:()=>this.getContract().write.depositWithPermit([i,s,r,a,o,c,h],{account:e,chain:this.viemChain}),estimate:()=>this.getContract().estimateGas.depositWithPermit([i,s,r,a,o,c,h],{account:e})}}}exports.NucleusTellerHandler=A;
1
+ "use strict";var S=Object.defineProperty;var T=(r,t,e)=>t in r?S(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var u=(r,t,e)=>T(r,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("../../constants-DA2xUb9r.cjs"),p=require("../addresses.cjs"),k=require("../abis/nucleus-teller-abis.cjs"),l=require("../tokens.cjs"),E=require("./erc20-permit-handler.cjs"),_=require("../../getContract-3QbyfZBF.cjs");class v{constructor(t,e,i){u(this,"viemChain");u(this,"erc20PermitHandler");u(this,"token");this.chain=t,this.walletClient=e,this.publicClient=i,this.viemChain=P.VIEM_CHAINS[t],this.erc20PermitHandler=new E.ERC20PermitHandler(t,e,i),this.token=l.UnifiToken.unifiETH}withToken(t){return this.token=t,this}getContract(){const t=p.NUCLEUS_CONTRACT_ADDRESSES[this.token][this.chain].NucleusTeller,e=k.NUCLEUS_TELLER_ABIS[this.chain].Teller,i={public:this.publicClient,wallet:this.walletClient};return _.getContract({address:t,abi:e,client:i})}accountant(){return this.getContract().read.accountant()}vault(){return this.getContract().read.vault()}shareLockPeriod(){return this.getContract().read.shareLockPeriod()}shareUnlockTime(t){return this.getContract().read.shareUnlockTime([t])}isPaused(){return this.getContract().read.isPaused()}async deposit(t){const{token:e,unifiToken:i,account:s,amount:n,minimumMint:a,isPreapproved:o=!1}=t,c=l.TOKENS_ADDRESSES[e][this.chain];if(o)return{transact:()=>this.getContract().write.deposit([c,n,a],{account:s,chain:this.viemChain}),estimate:()=>this.getContract().estimateGas.deposit([c,n,a],{account:s})};const{r:h,s:d,v:m,deadline:g}=await this.erc20PermitHandler.withToken(e).getPermitSignature(s,l.TOKENS_ADDRESSES[i][this.chain],n),C=[c,n,a,g,Number(m),h,d];return{transact:()=>this.getContract().write.depositWithPermit(C,{account:s,chain:this.viemChain}),estimate:()=>this.getContract().estimateGas.depositWithPermit(C,{account:s})}}depositWithPermit(t){const{account:e,depositAsset:i,depositAmount:s,minimumMint:n,deadline:a,v:o,r:c,s:h}=t;return{transact:()=>this.getContract().write.depositWithPermit([i,s,n,a,o,c,h],{account:e,chain:this.viemChain}),estimate:()=>this.getContract().estimateGas.depositWithPermit([i,s,n,a,o,c,h],{account:e})}}}exports.NucleusTellerHandler=v;
2
2
  //# sourceMappingURL=nucleus-teller-handler.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"nucleus-teller-handler.cjs","sources":["../../../lib/contracts/handlers/nucleus-teller-handler.ts"],"sourcesContent":["import {\n WalletClient,\n PublicClient,\n getContract,\n Address,\n GetContractReturnType,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport { CONTRACT_ADDRESSES } from '../addresses';\nimport { NUCLEUS_TELLER_ABIS } from '../abis/nucleus-teller-abis';\nimport { Token, TOKENS_ADDRESSES, UnifiToken } from '../tokens';\nimport { ERC20PermitHandler } from './erc20-permit-handler';\n\nexport type DepositParams = {\n account: Address;\n token: Token;\n unifiToken: UnifiToken;\n amount: bigint;\n minimumMint: bigint;\n isPreapproved?: boolean;\n};\n\nexport type DepositWithPermitParams = {\n account: Address;\n depositAsset: Address;\n depositAmount: bigint;\n minimumMint: bigint;\n deadline: bigint;\n v: number;\n r: Address;\n s: Address;\n};\n\n/**\n * Handler for the `Teller` contract from nucleus.\n */\nexport class NucleusTellerHandler {\n private viemChain: ViemChain;\n private erc20PermitHandler: ERC20PermitHandler;\n\n /**\n * Create the handler for processing tokens.\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. 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].NucleusTeller as Address;\n const abi = NUCLEUS_TELLER_ABIS[this.chain].Teller;\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 * Get the address of the `Accountant` contract.\n *\n * @returns The address of the `Accountant` contract.\n */\n public accountant() {\n return this.getContract().read.accountant();\n }\n\n /**\n * Get the address of the `BoringVault` contract.\n *\n * @returns The address of the `BoringVault` contract.\n */\n public vault() {\n return this.getContract().read.vault();\n }\n\n /**\n * Get the share lock period.\n *\n * @returns The share lock period.\n */\n public shareLockPeriod() {\n return this.getContract().read.shareLockPeriod();\n }\n\n /**\n * Get the share unlock time for the given wallet address.\n *\n * @param walletAddress Address of the wallet.\n * @returns The share unlock time.\n */\n public shareUnlockTime(walletAddress: Address) {\n return this.getContract().read.shareUnlockTime([walletAddress]);\n }\n\n /**\n * Get the paused state of the contract.\n *\n * @returns The paused state of the contract.\n */\n public isPaused() {\n return this.getContract().read.isPaused();\n }\n\n /**\n * Deposit the given token for staking. This doesn't make the\n * transaction but returns two methods namely `transact` and\n * `estimate`.\n *\n * @param params Deposit parameters.\n * @param params.account Address of the caller of the transaction.\n * @param params.token Token to deposit.\n * @param params.unifiToken UniFi token to get in return of the deposit.\n * @param params.amount Amount of the token to deposit.\n * @param params.minimumMint Minimum amount of shares to mint.\n * @param params.isPreapproved Whether the token is preapproved.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public async deposit(params: DepositParams) {\n const {\n token,\n unifiToken,\n account,\n amount,\n minimumMint,\n isPreapproved = false,\n } = params;\n const tokenAddress = TOKENS_ADDRESSES[token][this.chain];\n\n if (isPreapproved) {\n return {\n transact: () =>\n this.getContract().write.deposit(\n [tokenAddress, amount, minimumMint],\n {\n account,\n chain: this.viemChain,\n },\n ),\n estimate: () =>\n this.getContract().estimateGas.deposit(\n [tokenAddress, amount, minimumMint],\n { account },\n ),\n };\n }\n\n const { r, s, v, deadline } = await this.erc20PermitHandler\n .withToken(token)\n .getPermitSignature(\n account,\n // The UniFi token contract is the spender.\n TOKENS_ADDRESSES[unifiToken][this.chain],\n amount,\n );\n\n const depositArgs = <const>[\n tokenAddress,\n amount,\n minimumMint,\n deadline,\n Number(v),\n r,\n s,\n ];\n\n const transact = () =>\n this.getContract().write.depositWithPermit(depositArgs, {\n account,\n chain: this.viemChain,\n });\n const estimate = () =>\n this.getContract().estimateGas.depositWithPermit(depositArgs, {\n account,\n });\n\n return { transact, estimate };\n }\n\n /**\n * Deposit an asset/token for staking with a permit.\n *\n * @param params Permit parameters.\n * @param params.account Address of the caller of the transaction.\n * @param params.depositAsset Address of the asset/token to deposit.\n * @param params.depositAmount Amount of the asset/token to deposit.\n * @param params.minimumMint Minimum amount of shares to mint.\n * @param params.deadline Deadline for the permit.\n * @param params.v v value of the permit.\n * @param params.r r value of the permit.\n * @param params.s s value of the permit.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public depositWithPermit(params: DepositWithPermitParams) {\n const {\n account,\n depositAsset,\n depositAmount,\n minimumMint,\n deadline,\n v,\n r,\n s,\n } = params;\n\n const transact = () =>\n this.getContract().write.depositWithPermit(\n [depositAsset, depositAmount, minimumMint, deadline, v, r, s],\n {\n account,\n chain: this.viemChain,\n },\n );\n const estimate = () =>\n this.getContract().estimateGas.depositWithPermit(\n [depositAsset, depositAmount, minimumMint, deadline, v, r, s],\n {\n account,\n },\n );\n\n return { transact, estimate };\n }\n}\n"],"names":["NucleusTellerHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","ERC20PermitHandler","address","CONTRACT_ADDRESSES","abi","NUCLEUS_TELLER_ABIS","client","getContract","walletAddress","params","token","unifiToken","account","amount","minimumMint","isPreapproved","tokenAddress","TOKENS_ADDRESSES","r","s","v","deadline","depositArgs","depositAsset","depositAmount"],"mappings":"8dAoCO,MAAMA,CAAqB,CAahC,YACUC,EACAC,EACAC,EACR,CAhBMC,EAAA,kBACAA,EAAA,2BAYE,KAAA,MAAAH,EACA,KAAA,aAAAC,EACA,KAAA,aAAAC,EAEH,KAAA,UAAYE,cAAYJ,CAAK,EAClC,KAAK,mBAAqB,IAAIK,EAAA,mBAC5BL,EACAC,EACAC,CACF,CAAA,CASK,aAAc,CACnB,MAAMI,EAAUC,EAAA,mBAAmB,KAAK,KAAK,EAAE,cACzCC,EAAMC,EAAA,oBAAoB,KAAK,KAAK,EAAE,OACtCC,EAAS,CAAE,OAAQ,KAAK,aAAc,OAAQ,KAAK,YAAa,EAEtE,OAAOC,EAAY,YAAA,CAAE,QAAAL,EAAS,IAAAE,EAAK,OAAAE,EAAQ,CAAA,CAYtC,YAAa,CAClB,OAAO,KAAK,cAAc,KAAK,WAAW,CAAA,CAQrC,OAAQ,CACb,OAAO,KAAK,cAAc,KAAK,MAAM,CAAA,CAQhC,iBAAkB,CACvB,OAAO,KAA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,CAAE,SAhBQ,IACf,KAAK,cAAc,MAAM,kBACvB,CAACc,EAAcC,EAAeV,EAAaO,EAAUD,EAAGF,EAAGC,CAAC,EAC5D,CACE,QAAAP,EACA,MAAO,KAAK,SAAA,CAEhB,EASiB,SARF,IACf,KAAK,cAAc,YAAY,kBAC7B,CAACW,EAAcC,EAAeV,EAAaO,EAAUD,EAAGF,EAAGC,CAAC,EAC5D,CACE,QAAAP,CAAA,CAEJ,CAE0B,CAAA,CAEhC"}
1
+ {"version":3,"file":"nucleus-teller-handler.cjs","sources":["../../../lib/contracts/handlers/nucleus-teller-handler.ts"],"sourcesContent":["import {\n WalletClient,\n PublicClient,\n getContract,\n Address,\n GetContractReturnType,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport { NUCLEUS_CONTRACT_ADDRESSES } from '../addresses';\nimport { NUCLEUS_TELLER_ABIS } from '../abis/nucleus-teller-abis';\nimport { Token, TOKENS_ADDRESSES, UnifiToken } from '../tokens';\nimport { ERC20PermitHandler } from './erc20-permit-handler';\n\nexport type DepositParams = {\n account: Address;\n token: Token;\n unifiToken: UnifiToken;\n amount: bigint;\n minimumMint: bigint;\n isPreapproved?: boolean;\n};\n\nexport type DepositWithPermitParams = {\n account: Address;\n depositAsset: Address;\n depositAmount: bigint;\n minimumMint: bigint;\n deadline: bigint;\n v: number;\n r: Address;\n s: Address;\n};\n\n/**\n * Handler for the `Teller` contract from nucleus.\n */\nexport class NucleusTellerHandler {\n private viemChain: ViemChain;\n private erc20PermitHandler: ERC20PermitHandler;\n private token: UnifiToken;\n\n /**\n * Create the handler for processing tokens.\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 this.token = UnifiToken.unifiETH;\n }\n\n /**\n * Set the UniFi token to use for executing transactions on the\n * contract.\n *\n * @param token UniFi token to use for the handler.\n * @returns The handler.\n */\n public withToken(token: UnifiToken) {\n this.token = token;\n return this;\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 = NUCLEUS_CONTRACT_ADDRESSES[this.token][this.chain]\n .NucleusTeller as Address;\n const abi = NUCLEUS_TELLER_ABIS[this.chain].Teller;\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 * Get the address of the `Accountant` contract.\n *\n * @returns The address of the `Accountant` contract.\n */\n public accountant() {\n return this.getContract().read.accountant();\n }\n\n /**\n * Get the address of the `BoringVault` contract.\n *\n * @returns The address of the `BoringVault` contract.\n */\n public vault() {\n return this.getContract().read.vault();\n }\n\n /**\n * Get the share lock period.\n *\n * @returns The share lock period.\n */\n public shareLockPeriod() {\n return this.getContract().read.shareLockPeriod();\n }\n\n /**\n * Get the share unlock time for the given wallet address.\n *\n * @param walletAddress Address of the wallet.\n * @returns The share unlock time.\n */\n public shareUnlockTime(walletAddress: Address) {\n return this.getContract().read.shareUnlockTime([walletAddress]);\n }\n\n /**\n * Get the paused state of the contract.\n *\n * @returns The paused state of the contract.\n */\n public isPaused() {\n return this.getContract().read.isPaused();\n }\n\n /**\n * Deposit the given token for staking. This doesn't make the\n * transaction but returns two methods namely `transact` and\n * `estimate`.\n *\n * @param params Deposit parameters.\n * @param params.account Address of the caller of the transaction.\n * @param params.token Token to deposit.\n * @param params.unifiToken UniFi token to get in return of the deposit.\n * @param params.amount Amount of the token to deposit.\n * @param params.minimumMint Minimum amount of shares to mint.\n * @param params.isPreapproved Whether the token is preapproved.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public async deposit(params: DepositParams) {\n const {\n token,\n unifiToken,\n account,\n amount,\n minimumMint,\n isPreapproved = false,\n } = params;\n const tokenAddress = TOKENS_ADDRESSES[token][this.chain];\n\n if (isPreapproved) {\n return {\n transact: () =>\n this.getContract().write.deposit(\n [tokenAddress, amount, minimumMint],\n {\n account,\n chain: this.viemChain,\n },\n ),\n estimate: () =>\n this.getContract().estimateGas.deposit(\n [tokenAddress, amount, minimumMint],\n { account },\n ),\n };\n }\n\n const { r, s, v, deadline } = await this.erc20PermitHandler\n .withToken(token)\n .getPermitSignature(\n account,\n // The UniFi token contract is the spender.\n TOKENS_ADDRESSES[unifiToken][this.chain],\n amount,\n );\n\n const depositArgs = <const>[\n tokenAddress,\n amount,\n minimumMint,\n deadline,\n Number(v),\n r,\n s,\n ];\n\n const transact = () =>\n this.getContract().write.depositWithPermit(depositArgs, {\n account,\n chain: this.viemChain,\n });\n const estimate = () =>\n this.getContract().estimateGas.depositWithPermit(depositArgs, {\n account,\n });\n\n return { transact, estimate };\n }\n\n /**\n * Deposit an asset/token for staking with a permit.\n *\n * @param params Permit parameters.\n * @param params.account Address of the caller of the transaction.\n * @param params.depositAsset Address of the asset/token to deposit.\n * @param params.depositAmount Amount of the asset/token to deposit.\n * @param params.minimumMint Minimum amount of shares to mint.\n * @param params.deadline Deadline for the permit.\n * @param params.v v value of the permit.\n * @param params.r r value of the permit.\n * @param params.s s value of the permit.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public depositWithPermit(params: DepositWithPermitParams) {\n const {\n account,\n depositAsset,\n depositAmount,\n minimumMint,\n deadline,\n v,\n r,\n s,\n } = params;\n\n const transact = () =>\n this.getContract().write.depositWithPermit(\n [depositAsset, depositAmount, minimumMint, deadline, v, r, s],\n {\n account,\n chain: this.viemChain,\n },\n );\n const estimate = () =>\n this.getContract().estimateGas.depositWithPermit(\n [depositAsset, depositAmount, minimumMint, deadline, v, r, s],\n {\n account,\n },\n );\n\n return { transact, estimate };\n }\n}\n"],"names":["NucleusTellerHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","ERC20PermitHandler","UnifiToken","token","address","NUCLEUS_CONTRACT_ADDRESSES","abi","NUCLEUS_TELLER_ABIS","client","getContract","walletAddress","params","unifiToken","account","amount","minimumMint","isPreapproved","tokenAddress","TOKENS_ADDRESSES","r","s","v","deadline","depositArgs","depositAsset","depositAmount"],"mappings":"8dAoCO,MAAMA,CAAqB,CAchC,YACUC,EACAC,EACAC,EACR,CAjBMC,EAAA,kBACAA,EAAA,2BACAA,EAAA,cAYE,KAAA,MAAAH,EACA,KAAA,aAAAC,EACA,KAAA,aAAAC,EAEH,KAAA,UAAYE,cAAYJ,CAAK,EAClC,KAAK,mBAAqB,IAAIK,EAAA,mBAC5BL,EACAC,EACAC,CACF,EACA,KAAK,MAAQI,EAAAA,WAAW,QAAA,CAUnB,UAAUC,EAAmB,CAClC,YAAK,MAAQA,EACN,IAAA,CASF,aAAc,CACnB,MAAMC,EAAUC,EAAAA,2BAA2B,KAAK,KAAK,EAAE,KAAK,KAAK,EAC9D,cACGC,EAAMC,EAAA,oBAAoB,KAAK,KAAK,EAAE,OACtCC,EAAS,CAAE,OAAQ,KAAK,aAAc,OAAQ,KAAK,YAAa,EAEtE,OAAOC,EAAY,YAAA,CAAE,QAAAL,EAAS,IAAAE,EAAK,OAAAE,EAAQ,CAAA,CAYtC,YAAa,CAClB,OAAO,KAAK,cAAc,KAAK,WAAW,CAAA,CAQrC,OAAQ,CACb,OAAO,KAAK,cAAc,KAAK,MAAM,CAAA,CAQhC,iBAAkB,CACvB,OAAO,KAAK,cAAc,KAAK,gBAAgB,CAAA,CAS1C,gBAAgBE,EAAwB,CAC7C,OAAO,KAAK,YAAY,EAAE,KAAK,gBAAgB,CAACA,CAAa,CAAC,CAAA,CAQzD,UAAW,CAChB,OAAO,KAAK,cAAc,KAA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f,KAAK,cAAc,YAAY,kBAC7B,CAACW,EAAcC,EAAeV,EAAaO,EAAUD,EAAGF,EAAGC,CAAC,EAC5D,CACE,QAAAP,CAAA,CAEJ,CAE0B,CAAA,CAEhC"}
@@ -28,6 +28,7 @@ export declare class NucleusTellerHandler {
28
28
  private publicClient;
29
29
  private viemChain;
30
30
  private erc20PermitHandler;
31
+ private token;
31
32
  /**
32
33
  * Create the handler for processing tokens.
33
34
  *
@@ -38,6 +39,14 @@ export declare class NucleusTellerHandler {
38
39
  * interactions.
39
40
  */
40
41
  constructor(chain: Chain, walletClient: WalletClient, publicClient: PublicClient);
42
+ /**
43
+ * Set the UniFi token to use for executing transactions on the
44
+ * contract.
45
+ *
46
+ * @param token UniFi token to use for the handler.
47
+ * @returns The handler.
48
+ */
49
+ withToken(token: UnifiToken): this;
41
50
  /**
42
51
  * Get the contract. This is a method because the typings are complex
43
52
  * and lost when trying to make it a member.
@@ -1,12 +1,12 @@
1
1
  var g = Object.defineProperty;
2
- var P = (a, t, e) => t in a ? g(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
- var m = (a, t, e) => P(a, typeof t != "symbol" ? t + "" : t, e);
4
- import { V as S } from "../../constants-BjRNQpT2.js";
5
- import { CONTRACT_ADDRESSES as T } from "../addresses.js";
6
- import { NUCLEUS_TELLER_ABIS as v } from "../abis/nucleus-teller-abis.js";
7
- import { TOKENS_ADDRESSES as C } from "../tokens.js";
8
- import { ERC20PermitHandler as E } from "./erc20-permit-handler.js";
9
- import { g as f } from "../../getContract-CezEyDf-.js";
2
+ var P = (n, t, e) => t in n ? g(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
+ var m = (n, t, e) => P(n, typeof t != "symbol" ? t + "" : t, e);
4
+ import { V as k } from "../../constants-BjRNQpT2.js";
5
+ import { NUCLEUS_CONTRACT_ADDRESSES as T } from "../addresses.js";
6
+ import { NUCLEUS_TELLER_ABIS as E } from "../abis/nucleus-teller-abis.js";
7
+ import { UnifiToken as S, TOKENS_ADDRESSES as C } from "../tokens.js";
8
+ import { ERC20PermitHandler as f } from "./erc20-permit-handler.js";
9
+ import { g as v } from "../../getContract-CezEyDf-.js";
10
10
  class b {
11
11
  /**
12
12
  * Create the handler for processing tokens.
@@ -20,11 +20,22 @@ class b {
20
20
  constructor(t, e, i) {
21
21
  m(this, "viemChain");
22
22
  m(this, "erc20PermitHandler");
23
- this.chain = t, this.walletClient = e, this.publicClient = i, this.viemChain = S[t], this.erc20PermitHandler = new E(
23
+ m(this, "token");
24
+ this.chain = t, this.walletClient = e, this.publicClient = i, this.viemChain = k[t], this.erc20PermitHandler = new f(
24
25
  t,
25
26
  e,
26
27
  i
27
- );
28
+ ), this.token = S.unifiETH;
29
+ }
30
+ /**
31
+ * Set the UniFi token to use for executing transactions on the
32
+ * contract.
33
+ *
34
+ * @param token UniFi token to use for the handler.
35
+ * @returns The handler.
36
+ */
37
+ withToken(t) {
38
+ return this.token = t, this;
28
39
  }
29
40
  /**
30
41
  * Get the contract. This is a method because the typings are complex
@@ -33,8 +44,8 @@ class b {
33
44
  * @returns The viem contract.
34
45
  */
35
46
  getContract() {
36
- const t = T[this.chain].NucleusTeller, e = v[this.chain].Teller, i = { public: this.publicClient, wallet: this.walletClient };
37
- return f({ address: t, abi: e, client: i });
47
+ const t = T[this.token][this.chain].NucleusTeller, e = E[this.chain].Teller, i = { public: this.publicClient, wallet: this.walletClient };
48
+ return v({ address: t, abi: e, client: i });
38
49
  }
39
50
  /**
40
51
  * Get the address of the `Accountant` contract.
@@ -101,20 +112,20 @@ class b {
101
112
  unifiToken: i,
102
113
  account: r,
103
114
  amount: s,
104
- minimumMint: n,
115
+ minimumMint: a,
105
116
  isPreapproved: c = !1
106
117
  } = t, o = C[e][this.chain];
107
118
  if (c)
108
119
  return {
109
120
  transact: () => this.getContract().write.deposit(
110
- [o, s, n],
121
+ [o, s, a],
111
122
  {
112
123
  account: r,
113
124
  chain: this.viemChain
114
125
  }
115
126
  ),
116
127
  estimate: () => this.getContract().estimateGas.deposit(
117
- [o, s, n],
128
+ [o, s, a],
118
129
  { account: r }
119
130
  )
120
131
  };
@@ -126,7 +137,7 @@ class b {
126
137
  ), l = [
127
138
  o,
128
139
  s,
129
- n,
140
+ a,
130
141
  p,
131
142
  Number(u),
132
143
  h,
@@ -163,19 +174,19 @@ class b {
163
174
  depositAsset: i,
164
175
  depositAmount: r,
165
176
  minimumMint: s,
166
- deadline: n,
177
+ deadline: a,
167
178
  v: c,
168
179
  r: o,
169
180
  s: h
170
181
  } = t;
171
182
  return { transact: () => this.getContract().write.depositWithPermit(
172
- [i, r, s, n, c, o, h],
183
+ [i, r, s, a, c, o, h],
173
184
  {
174
185
  account: e,
175
186
  chain: this.viemChain
176
187
  }
177
188
  ), estimate: () => this.getContract().estimateGas.depositWithPermit(
178
- [i, r, s, n, c, o, h],
189
+ [i, r, s, a, c, o, h],
179
190
  {
180
191
  account: e
181
192
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nucleus-teller-handler.js","sources":["../../../lib/contracts/handlers/nucleus-teller-handler.ts"],"sourcesContent":["import {\n WalletClient,\n PublicClient,\n getContract,\n Address,\n GetContractReturnType,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport { CONTRACT_ADDRESSES } from '../addresses';\nimport { NUCLEUS_TELLER_ABIS } from '../abis/nucleus-teller-abis';\nimport { Token, TOKENS_ADDRESSES, UnifiToken } from '../tokens';\nimport { ERC20PermitHandler } from './erc20-permit-handler';\n\nexport type DepositParams = {\n account: Address;\n token: Token;\n unifiToken: UnifiToken;\n amount: bigint;\n minimumMint: bigint;\n isPreapproved?: boolean;\n};\n\nexport type DepositWithPermitParams = {\n account: Address;\n depositAsset: Address;\n depositAmount: bigint;\n minimumMint: bigint;\n deadline: bigint;\n v: number;\n r: Address;\n s: Address;\n};\n\n/**\n * Handler for the `Teller` contract from nucleus.\n */\nexport class NucleusTellerHandler {\n private viemChain: ViemChain;\n private erc20PermitHandler: ERC20PermitHandler;\n\n /**\n * Create the handler for processing tokens.\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. 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].NucleusTeller as Address;\n const abi = NUCLEUS_TELLER_ABIS[this.chain].Teller;\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 * Get the address of the `Accountant` contract.\n *\n * @returns The address of the `Accountant` contract.\n */\n public accountant() {\n return this.getContract().read.accountant();\n }\n\n /**\n * Get the address of the `BoringVault` contract.\n *\n * @returns The address of the `BoringVault` contract.\n */\n public vault() {\n return this.getContract().read.vault();\n }\n\n /**\n * Get the share lock period.\n *\n * @returns The share lock period.\n */\n public shareLockPeriod() {\n return this.getContract().read.shareLockPeriod();\n }\n\n /**\n * Get the share unlock time for the given wallet address.\n *\n * @param walletAddress Address of the wallet.\n * @returns The share unlock time.\n */\n public shareUnlockTime(walletAddress: Address) {\n return this.getContract().read.shareUnlockTime([walletAddress]);\n }\n\n /**\n * Get the paused state of the contract.\n *\n * @returns The paused state of the contract.\n */\n public isPaused() {\n return this.getContract().read.isPaused();\n }\n\n /**\n * Deposit the given token for staking. This doesn't make the\n * transaction but returns two methods namely `transact` and\n * `estimate`.\n *\n * @param params Deposit parameters.\n * @param params.account Address of the caller of the transaction.\n * @param params.token Token to deposit.\n * @param params.unifiToken UniFi token to get in return of the deposit.\n * @param params.amount Amount of the token to deposit.\n * @param params.minimumMint Minimum amount of shares to mint.\n * @param params.isPreapproved Whether the token is preapproved.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public async deposit(params: DepositParams) {\n const {\n token,\n unifiToken,\n account,\n amount,\n minimumMint,\n isPreapproved = false,\n } = params;\n const tokenAddress = TOKENS_ADDRESSES[token][this.chain];\n\n if (isPreapproved) {\n return {\n transact: () =>\n this.getContract().write.deposit(\n [tokenAddress, amount, minimumMint],\n {\n account,\n chain: this.viemChain,\n },\n ),\n estimate: () =>\n this.getContract().estimateGas.deposit(\n [tokenAddress, amount, minimumMint],\n { account },\n ),\n };\n }\n\n const { r, s, v, deadline } = await this.erc20PermitHandler\n .withToken(token)\n .getPermitSignature(\n account,\n // The UniFi token contract is the spender.\n TOKENS_ADDRESSES[unifiToken][this.chain],\n amount,\n );\n\n const depositArgs = <const>[\n tokenAddress,\n amount,\n minimumMint,\n deadline,\n Number(v),\n r,\n s,\n ];\n\n const transact = () =>\n this.getContract().write.depositWithPermit(depositArgs, {\n account,\n chain: this.viemChain,\n });\n const estimate = () =>\n this.getContract().estimateGas.depositWithPermit(depositArgs, {\n account,\n });\n\n return { transact, estimate };\n }\n\n /**\n * Deposit an asset/token for staking with a permit.\n *\n * @param params Permit parameters.\n * @param params.account Address of the caller of the transaction.\n * @param params.depositAsset Address of the asset/token to deposit.\n * @param params.depositAmount Amount of the asset/token to deposit.\n * @param params.minimumMint Minimum amount of shares to mint.\n * @param params.deadline Deadline for the permit.\n * @param params.v v value of the permit.\n * @param params.r r value of the permit.\n * @param params.s s value of the permit.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public depositWithPermit(params: DepositWithPermitParams) {\n const {\n account,\n depositAsset,\n depositAmount,\n minimumMint,\n deadline,\n v,\n r,\n s,\n } = params;\n\n const transact = () =>\n this.getContract().write.depositWithPermit(\n [depositAsset, depositAmount, minimumMint, deadline, v, r, s],\n {\n account,\n chain: this.viemChain,\n },\n );\n const estimate = () =>\n this.getContract().estimateGas.depositWithPermit(\n [depositAsset, depositAmount, minimumMint, deadline, v, r, s],\n {\n account,\n },\n );\n\n return { transact, estimate };\n }\n}\n"],"names":["NucleusTellerHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","ERC20PermitHandler","address","CONTRACT_ADDRESSES","abi","NUCLEUS_TELLER_ABIS","client","getContract","walletAddress","params","token","unifiToken","account","amount","minimumMint","isPreapproved","tokenAddress","TOKENS_ADDRESSES","r","s","v","deadline","depositArgs","depositAsset","depositAmount"],"mappings":";;;;;;;;;AAoCO,MAAMA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAahC,YACUC,GACAC,GACAC,GACR;AAhBM,IAAAC,EAAA;AACA,IAAAA,EAAA;AAYE,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;AAAA,EASK,cAAc;AACnB,UAAMI,IAAUC,EAAmB,KAAK,KAAK,EAAE,eACzCC,IAAMC,EAAoB,KAAK,KAAK,EAAE,QACtCC,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,EAYtC,aAAa;AAClB,WAAO,KAAK,cAAc,KAAK,WAAW;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQrC,QAAQ;AACb,WAAO,KAAK,cAAc,KAAK,MAAM;AAAA,EA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AA,MACAH;AAAA,MACAC;AAAA,MACAO;AAAA,MACA,OAAOD,CAAC;AAAA,MACRF;AAAA,MACAC;AAAA,IACF;AAYO,WAAA,EAAE,UAVQ,MACf,KAAK,YAAc,EAAA,MAAM,kBAAkBG,GAAa;AAAA,MACtD,SAAAV;AAAA,MACA,OAAO,KAAK;AAAA,IAAA,CACb,GAMgB,UALF,MACf,KAAK,YAAc,EAAA,YAAY,kBAAkBU,GAAa;AAAA,MAC5D,SAAAV;AAAA,IAAA,CACD,EAEyB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBvB,kBAAkBH,GAAiC;AAClD,UAAA;AAAA,MACJ,SAAAG;AAAA,MACA,cAAAW;AAAA,MACA,eAAAC;AAAA,MACA,aAAAV;AAAA,MACA,UAAAO;AAAA,MACA,GAAAD;AAAA,MACA,GAAAF;AAAA,MACA,GAAAC;AAAA,IAAA,IACEV;AAkBG,WAAA,EAAE,UAhBQ,MACf,KAAK,cAAc,MAAM;AAAA,MACvB,CAACc,GAAcC,GAAeV,GAAaO,GAAUD,GAAGF,GAAGC,CAAC;AAAA,MAC5D;AAAA,QACE,SAAAP;AAAA,QACA,OAAO,KAAK;AAAA,MAAA;AAAA,IAEhB,GASiB,UARF,MACf,KAAK,cAAc,YAAY;AAAA,MAC7B,CAACW,GAAcC,GAAeV,GAAaO,GAAUD,GAAGF,GAAGC,CAAC;AAAA,MAC5D;AAAA,QACE,SAAAP;AAAA,MAAA;AAAA,IAEJ,EAE0B;AAAA,EAAA;AAEhC;"}
1
+ {"version":3,"file":"nucleus-teller-handler.js","sources":["../../../lib/contracts/handlers/nucleus-teller-handler.ts"],"sourcesContent":["import {\n WalletClient,\n PublicClient,\n getContract,\n Address,\n GetContractReturnType,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport { NUCLEUS_CONTRACT_ADDRESSES } from '../addresses';\nimport { NUCLEUS_TELLER_ABIS } from '../abis/nucleus-teller-abis';\nimport { Token, TOKENS_ADDRESSES, UnifiToken } from '../tokens';\nimport { ERC20PermitHandler } from './erc20-permit-handler';\n\nexport type DepositParams = {\n account: Address;\n token: Token;\n unifiToken: UnifiToken;\n amount: bigint;\n minimumMint: bigint;\n isPreapproved?: boolean;\n};\n\nexport type DepositWithPermitParams = {\n account: Address;\n depositAsset: Address;\n depositAmount: bigint;\n minimumMint: bigint;\n deadline: bigint;\n v: number;\n r: Address;\n s: Address;\n};\n\n/**\n * Handler for the `Teller` contract from nucleus.\n */\nexport class NucleusTellerHandler {\n private viemChain: ViemChain;\n private erc20PermitHandler: ERC20PermitHandler;\n private token: UnifiToken;\n\n /**\n * Create the handler for processing tokens.\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 this.token = UnifiToken.unifiETH;\n }\n\n /**\n * Set the UniFi token to use for executing transactions on the\n * contract.\n *\n * @param token UniFi token to use for the handler.\n * @returns The handler.\n */\n public withToken(token: UnifiToken) {\n this.token = token;\n return this;\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 = NUCLEUS_CONTRACT_ADDRESSES[this.token][this.chain]\n .NucleusTeller as Address;\n const abi = NUCLEUS_TELLER_ABIS[this.chain].Teller;\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 * Get the address of the `Accountant` contract.\n *\n * @returns The address of the `Accountant` contract.\n */\n public accountant() {\n return this.getContract().read.accountant();\n }\n\n /**\n * Get the address of the `BoringVault` contract.\n *\n * @returns The address of the `BoringVault` contract.\n */\n public vault() {\n return this.getContract().read.vault();\n }\n\n /**\n * Get the share lock period.\n *\n * @returns The share lock period.\n */\n public shareLockPeriod() {\n return this.getContract().read.shareLockPeriod();\n }\n\n /**\n * Get the share unlock time for the given wallet address.\n *\n * @param walletAddress Address of the wallet.\n * @returns The share unlock time.\n */\n public shareUnlockTime(walletAddress: Address) {\n return this.getContract().read.shareUnlockTime([walletAddress]);\n }\n\n /**\n * Get the paused state of the contract.\n *\n * @returns The paused state of the contract.\n */\n public isPaused() {\n return this.getContract().read.isPaused();\n }\n\n /**\n * Deposit the given token for staking. This doesn't make the\n * transaction but returns two methods namely `transact` and\n * `estimate`.\n *\n * @param params Deposit parameters.\n * @param params.account Address of the caller of the transaction.\n * @param params.token Token to deposit.\n * @param params.unifiToken UniFi token to get in return of the deposit.\n * @param params.amount Amount of the token to deposit.\n * @param params.minimumMint Minimum amount of shares to mint.\n * @param params.isPreapproved Whether the token is preapproved.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public async deposit(params: DepositParams) {\n const {\n token,\n unifiToken,\n account,\n amount,\n minimumMint,\n isPreapproved = false,\n } = params;\n const tokenAddress = TOKENS_ADDRESSES[token][this.chain];\n\n if (isPreapproved) {\n return {\n transact: () =>\n this.getContract().write.deposit(\n [tokenAddress, amount, minimumMint],\n {\n account,\n chain: this.viemChain,\n },\n ),\n estimate: () =>\n this.getContract().estimateGas.deposit(\n [tokenAddress, amount, minimumMint],\n { account },\n ),\n };\n }\n\n const { r, s, v, deadline } = await this.erc20PermitHandler\n .withToken(token)\n .getPermitSignature(\n account,\n // The UniFi token contract is the spender.\n TOKENS_ADDRESSES[unifiToken][this.chain],\n amount,\n );\n\n const depositArgs = <const>[\n tokenAddress,\n amount,\n minimumMint,\n deadline,\n Number(v),\n r,\n s,\n ];\n\n const transact = () =>\n this.getContract().write.depositWithPermit(depositArgs, {\n account,\n chain: this.viemChain,\n });\n const estimate = () =>\n this.getContract().estimateGas.depositWithPermit(depositArgs, {\n account,\n });\n\n return { transact, estimate };\n }\n\n /**\n * Deposit an asset/token for staking with a permit.\n *\n * @param params Permit parameters.\n * @param params.account Address of the caller of the transaction.\n * @param params.depositAsset Address of the asset/token to deposit.\n * @param params.depositAmount Amount of the asset/token to deposit.\n * @param params.minimumMint Minimum amount of shares to mint.\n * @param params.deadline Deadline for the permit.\n * @param params.v v value of the permit.\n * @param params.r r value of the permit.\n * @param params.s s value of the permit.\n * @returns `transact: () => Promise<Address>` - Used to make the\n * transaction with the given value.\n *\n * `estimate: () => Promise<bigint>` - Gas estimate of the\n * transaction.\n */\n public depositWithPermit(params: DepositWithPermitParams) {\n const {\n account,\n depositAsset,\n depositAmount,\n minimumMint,\n deadline,\n v,\n r,\n s,\n } = params;\n\n const transact = () =>\n this.getContract().write.depositWithPermit(\n [depositAsset, depositAmount, minimumMint, deadline, v, r, s],\n {\n account,\n chain: this.viemChain,\n },\n );\n const estimate = () =>\n this.getContract().estimateGas.depositWithPermit(\n [depositAsset, depositAmount, minimumMint, deadline, v, r, s],\n {\n account,\n },\n );\n\n return { transact, estimate };\n }\n}\n"],"names":["NucleusTellerHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","ERC20PermitHandler","UnifiToken","token","address","NUCLEUS_CONTRACT_ADDRESSES","abi","NUCLEUS_TELLER_ABIS","client","getContract","walletAddress","params","unifiToken","account","amount","minimumMint","isPreapproved","tokenAddress","TOKENS_ADDRESSES","r","s","v","deadline","depositArgs","depositAsset","depositAmount"],"mappings":";;;;;;;;;AAoCO,MAAMA,EAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAchC,YACUC,GACAC,GACAC,GACR;AAjBM,IAAAC,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EA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AA;AAAA;AAAA,EAqBvB,kBAAkBF,GAAiC;AAClD,UAAA;AAAA,MACJ,SAAAE;AAAA,MACA,cAAAW;AAAA,MACA,eAAAC;AAAA,MACA,aAAAV;AAAA,MACA,UAAAO;AAAA,MACA,GAAAD;AAAA,MACA,GAAAF;AAAA,MACA,GAAAC;AAAA,IAAA,IACET;AAkBG,WAAA,EAAE,UAhBQ,MACf,KAAK,cAAc,MAAM;AAAA,MACvB,CAACa,GAAcC,GAAeV,GAAaO,GAAUD,GAAGF,GAAGC,CAAC;AAAA,MAC5D;AAAA,QACE,SAAAP;AAAA,QACA,OAAO,KAAK;AAAA,MAAA;AAAA,IAEhB,GASiB,UARF,MACf,KAAK,cAAc,YAAY;AAAA,MAC7B,CAACW,GAAcC,GAAeV,GAAaO,GAAUD,GAAGF,GAAGC,CAAC;AAAA,MAC5D;AAAA,QACE,SAAAP;AAAA,MAAA;AAAA,IAEJ,EAE0B;AAAA,EAAA;AAEhC;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../constants-DA2xUb9r.cjs");var c=(e=>(e.USDT="USDT",e.USDC="USDC",e.DAI="DAI",e.WETH="WETH",e.stETH="stETH",e.wstETH="wstETH",e.ALT="ALT",e.eETH="eETH",e.pufETHwstE="pufETHwstE",e.pufETH="pufETH",e))(c||{}),n=(e=>(e.unifiETH="unifiETH",e))(n||{});const E={USDT:{[a.Chain.Mainnet]:"0xdac17f958d2ee523a2206206994597c13d831ec7",[a.Chain.Holesky]:"0xd5bef2c64f418fd460319521d37862327122e3bc"},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"},stETH:{[a.Chain.Mainnet]:"0xae7ab96520de3a18e5e111b5eaab095312d7fe84",[a.Chain.Holesky]:"0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034"},wstETH:{[a.Chain.Mainnet]:"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",[a.Chain.Holesky]:"0x8d09a4502Cc8Cf1547aD300E066060D043f6982D"},ALT:{[a.Chain.Mainnet]:"0x8457ca5040ad67fdebbcc8edce889a335bc0fbfb",[a.Chain.Holesky]:"0xaf5588a571b42c7e50bd440d80f9bf94a4db94ee"},eETH:{[a.Chain.Mainnet]:"0x35fa164735182de50811e8e2e824cfb9b6118ac2",[a.Chain.Holesky]:"0x7ba2ee123b5977e3da040e1eacb3a61c82c17876"},pufETHwstE:{[a.Chain.Mainnet]:"0xeeda34a377dd0ca676b9511ee1324974fa8d980d",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},pufETH:{[a.Chain.Mainnet]:"0xd9a442856c234a39a81a089c06451ebaa4306a72",[a.Chain.Holesky]:"0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9"},unifiETH:{[a.Chain.Mainnet]:"0x196ead472583bc1e9af7a05f860d9857e1bd3dcc",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"}},i={USDT:"2",USDC:"",DAI:"",WETH:"",stETH:"2",wstETH:"1",ALT:"1",eETH:"1",pufETHwstE:"v7.0.0",pufETH:"1",unifiETH:"1"},d={pufETHwstE:{[a.Chain.Mainnet]:"0x0e986ed5610121905f03fd3850cebcc00f66166fc3ab760acb4e087d735d9457",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000000000000000000000000000"}};exports.TOKENS_ADDRESSES=E;exports.TOKENS_PERMIT_VERSION=i;exports.TOKENS_SALT=d;exports.Token=c;exports.UnifiToken=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("../constants-DA2xUb9r.cjs");var i=(e=>(e.USDT="USDT",e.USDC="USDC",e.DAI="DAI",e.WETH="WETH",e.stETH="stETH",e.wstETH="wstETH",e.ALT="ALT",e.eETH="eETH",e.pufETHwstE="pufETHwstE",e.pufETH="pufETH",e.WBTC="WBTC",e.LBTC="LBTC",e.tBTC="tBTC",e.cbBTC="cbBTC",e))(i||{}),n=(e=>(e.unifiETH="unifiETH",e.unifiUSD="unifiUSD",e.unifiBTC="unifiBTC",e))(n||{});const c={USDT:{[a.Chain.Mainnet]:"0xdac17f958d2ee523a2206206994597c13d831ec7",[a.Chain.Holesky]:"0xd5bef2c64f418fd460319521d37862327122e3bc"},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"},stETH:{[a.Chain.Mainnet]:"0xae7ab96520de3a18e5e111b5eaab095312d7fe84",[a.Chain.Holesky]:"0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034"},wstETH:{[a.Chain.Mainnet]:"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",[a.Chain.Holesky]:"0x8d09a4502Cc8Cf1547aD300E066060D043f6982D"},ALT:{[a.Chain.Mainnet]:"0x8457ca5040ad67fdebbcc8edce889a335bc0fbfb",[a.Chain.Holesky]:"0xaf5588a571b42c7e50bd440d80f9bf94a4db94ee"},eETH:{[a.Chain.Mainnet]:"0x35fa164735182de50811e8e2e824cfb9b6118ac2",[a.Chain.Holesky]:"0x7ba2ee123b5977e3da040e1eacb3a61c82c17876"},pufETHwstE:{[a.Chain.Mainnet]:"0xeeda34a377dd0ca676b9511ee1324974fa8d980d",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},pufETH:{[a.Chain.Mainnet]:"0xd9a442856c234a39a81a089c06451ebaa4306a72",[a.Chain.Holesky]:"0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9"},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"},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"}},C={USDT:"2",USDC:"",DAI:"",WETH:"",stETH:"2",wstETH:"1",ALT:"1",eETH:"1",pufETHwstE:"v7.0.0",pufETH:"1",WBTC:"",LBTC:"",tBTC:"",cbBTC:"",unifiETH:"1",unifiUSD:"1",unifiBTC:"1"},f={pufETHwstE:{[a.Chain.Mainnet]:"0x0e986ed5610121905f03fd3850cebcc00f66166fc3ab760acb4e087d735d9457",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000000000000000000000000000"}};exports.TOKENS_ADDRESSES=c;exports.TOKENS_PERMIT_VERSION=C;exports.TOKENS_SALT=f;exports.Token=i;exports.UnifiToken=n;
2
2
  //# sourceMappingURL=tokens.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokens.cjs","sources":["../../lib/contracts/tokens.ts"],"sourcesContent":["import { Address } from 'viem';\nimport { Chain } from '../chains/constants';\n\nexport enum Token {\n USDT = 'USDT',\n USDC = 'USDC',\n DAI = 'DAI',\n WETH = 'WETH',\n stETH = 'stETH',\n wstETH = 'wstETH',\n ALT = 'ALT',\n eETH = 'eETH',\n pufETHwstE = 'pufETHwstE',\n pufETH = 'pufETH',\n}\n\nexport enum UnifiToken {\n unifiETH = 'unifiETH',\n}\n\nexport type AnyToken = Token | UnifiToken;\n\nexport const TOKENS_ADDRESSES: {\n [key in AnyToken]: { [chain in Chain]: Address };\n} = {\n [Token.USDT]: {\n [Chain.Mainnet]: '0xdac17f958d2ee523a2206206994597c13d831ec7',\n [Chain.Holesky]: '0xd5bef2c64f418fd460319521d37862327122e3bc',\n },\n [Token.USDC]: {\n [Chain.Mainnet]: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n [Chain.Holesky]: '0x64Cc0de0429bcb87e875905a0c313ec88f6d1d3E',\n },\n [Token.DAI]: {\n [Chain.Mainnet]: '0x6b175474e89094c44da98b954eedeac495271d0f',\n [Chain.Holesky]: '0x4478905505ddfb7eA1c8A9f46eAEC3695cE542ac',\n },\n [Token.WETH]: {\n [Chain.Mainnet]: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n [Chain.Holesky]: '0x1d181cBd1825e9eBC6AD966878D555A7215FF4F0',\n },\n [Token.stETH]: {\n [Chain.Mainnet]: '0xae7ab96520de3a18e5e111b5eaab095312d7fe84',\n [Chain.Holesky]: '0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034',\n },\n [Token.wstETH]: {\n [Chain.Mainnet]: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',\n [Chain.Holesky]: '0x8d09a4502Cc8Cf1547aD300E066060D043f6982D',\n },\n [Token.ALT]: {\n [Chain.Mainnet]: '0x8457ca5040ad67fdebbcc8edce889a335bc0fbfb',\n [Chain.Holesky]: '0xaf5588a571b42c7e50bd440d80f9bf94a4db94ee',\n },\n [Token.eETH]: {\n [Chain.Mainnet]: '0x35fa164735182de50811e8e2e824cfb9b6118ac2',\n [Chain.Holesky]: '0x7ba2ee123b5977e3da040e1eacb3a61c82c17876',\n },\n [Token.pufETHwstE]: {\n [Chain.Mainnet]: '0xeeda34a377dd0ca676b9511ee1324974fa8d980d',\n [Chain.Holesky]: '0x0000000000000000000000000000000000000000',\n },\n [Token.pufETH]: {\n [Chain.Mainnet]: '0xd9a442856c234a39a81a089c06451ebaa4306a72',\n [Chain.Holesky]: '0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9',\n },\n\n // TODO: Update the addresses once the contracts are deployed on chain.\n // See https://dev.azure.com/pufferfi/Frontend/_workitems/edit/1797.\n\n // UniFi Tokens\n [UnifiToken.unifiETH]: {\n [Chain.Mainnet]: '0x196ead472583bc1e9af7a05f860d9857e1bd3dcc',\n [Chain.Holesky]: '0x0000000000000000000000000000000000000000',\n },\n};\n\nexport const TOKENS_PERMIT_VERSION: { [key in AnyToken]: string } = {\n [Token.USDT]: '2',\n // USDC does not support permit signatures (ERC20Permit).\n [Token.USDC]: '',\n // DAI does not support permit signatures (ERC20Permit).\n [Token.DAI]: '',\n // WETH does not support permit signatures (ERC20Permit).\n [Token.WETH]: '',\n [Token.stETH]: '2',\n // Puffer Quest v1 uses version 1 for wstETH.\n [Token.wstETH]: '1',\n [Token.ALT]: '1',\n // https://github.com/etherfi-protocol/smart-contracts/blob/7c66e571df4fe7ec502a3c325b623bc52349ef9d/src/EETH.sol#L55\n [Token.eETH]: '1',\n [Token.pufETHwstE]: 'v7.0.0',\n [Token.pufETH]: '1',\n\n // UniFi Tokens\n // https://etherscan.io/address/0x196ead472583bc1e9af7a05f860d9857e1bd3dcc#code#F7#L172\n [UnifiToken.unifiETH]: '1',\n};\n\nexport const TOKENS_SALT: Partial<{\n [key in AnyToken]: { [chain in Chain]: Address };\n}> = {\n [Token.pufETHwstE]: {\n // Taken from\n // https://etherscan.io/token/0xeeda34a377dd0ca676b9511ee1324974fa8d980d#readContract#F39.\n [Chain.Mainnet]:\n '0x0e986ed5610121905f03fd3850cebcc00f66166fc3ab760acb4e087d735d9457',\n [Chain.Holesky]:\n '0x0000000000000000000000000000000000000000000000000000000000000000',\n },\n};\n"],"names":["Token","UnifiToken","TOKENS_ADDRESSES","Chain","TOKENS_PERMIT_VERSION","TOKENS_SALT"],"mappings":"6HAGY,IAAAA,GAAAA,IACVA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,IAAM,MACNA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,IAAM,MACNA,EAAA,KAAO,OACPA,EAAA,WAAa,aACbA,EAAA,OAAS,SAVCA,IAAAA,GAAA,CAAA,CAAA,EAaAC,GAAAA,IACVA,EAAA,SAAW,WADDA,IAAAA,GAAA,CAAA,CAAA,EAML,MAAMC,EAET,CACD,KAAa,CACZ,CAACC,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CACnB,EACC,KAAa,CACZ,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CACnB,EACC,IAAY,CACX,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CACnB,EACC,KAAa,CACZ,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CACnB,EACC,MAAc,CACb,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CACnB,EACC,OAAe,CACd,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CACnB,EACC,IAAY,CACX,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CACnB,EACC,KAAa,CACZ,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CACnB,EACC,WAAmB,CAClB,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CACnB,EACC,OAAe,CACd,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CACnB,EAMC,SAAsB,CACrB,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CAAA,CAErB,EAEaC,EAAuD,CACjE,KAAa,IAEb,KAAa,GAEb,IAAY,GAEZ,KAAa,GACb,MAAc,IAEd,OAAe,IACf,IAAY,IAEZ,KAAa,IACb,WAAmB,SACnB,OAAe,IAIf,SAAsB,GACzB,EAEaC,EAER,CACF,WAAmB,CAGlB,CAACF,EAAAA,MAAM,OAAO,EACZ,qEACF,CAACA,EAAAA,MAAM,OAAO,EACZ,oEAAA,CAEN"}
1
+ {"version":3,"file":"tokens.cjs","sources":["../../lib/contracts/tokens.ts"],"sourcesContent":["import { Address } from 'viem';\nimport { Chain } from '../chains/constants';\n\nexport enum Token {\n USDT = 'USDT',\n USDC = 'USDC',\n DAI = 'DAI',\n WETH = 'WETH',\n stETH = 'stETH',\n wstETH = 'wstETH',\n ALT = 'ALT',\n eETH = 'eETH',\n pufETHwstE = 'pufETHwstE',\n pufETH = 'pufETH',\n WBTC = 'WBTC',\n LBTC = 'LBTC',\n tBTC = 'tBTC',\n cbBTC = 'cbBTC',\n}\n\nexport enum UnifiToken {\n unifiETH = 'unifiETH',\n unifiUSD = 'unifiUSD',\n unifiBTC = 'unifiBTC',\n}\n\nexport type AnyToken = Token | UnifiToken;\n\nexport const TOKENS_ADDRESSES: {\n [key in AnyToken]: { [chain in Chain]: Address };\n} = {\n [Token.USDT]: {\n [Chain.Mainnet]: '0xdac17f958d2ee523a2206206994597c13d831ec7',\n [Chain.Holesky]: '0xd5bef2c64f418fd460319521d37862327122e3bc',\n },\n [Token.USDC]: {\n [Chain.Mainnet]: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n [Chain.Holesky]: '0x64Cc0de0429bcb87e875905a0c313ec88f6d1d3E',\n },\n [Token.DAI]: {\n [Chain.Mainnet]: '0x6b175474e89094c44da98b954eedeac495271d0f',\n [Chain.Holesky]: '0x4478905505ddfb7eA1c8A9f46eAEC3695cE542ac',\n },\n [Token.WETH]: {\n [Chain.Mainnet]: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n [Chain.Holesky]: '0x1d181cBd1825e9eBC6AD966878D555A7215FF4F0',\n },\n [Token.stETH]: {\n [Chain.Mainnet]: '0xae7ab96520de3a18e5e111b5eaab095312d7fe84',\n [Chain.Holesky]: '0x3F1c547b21f65e10480dE3ad8E19fAAC46C95034',\n },\n [Token.wstETH]: {\n [Chain.Mainnet]: '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',\n [Chain.Holesky]: '0x8d09a4502Cc8Cf1547aD300E066060D043f6982D',\n },\n [Token.ALT]: {\n [Chain.Mainnet]: '0x8457ca5040ad67fdebbcc8edce889a335bc0fbfb',\n [Chain.Holesky]: '0xaf5588a571b42c7e50bd440d80f9bf94a4db94ee',\n },\n [Token.eETH]: {\n [Chain.Mainnet]: '0x35fa164735182de50811e8e2e824cfb9b6118ac2',\n [Chain.Holesky]: '0x7ba2ee123b5977e3da040e1eacb3a61c82c17876',\n },\n [Token.pufETHwstE]: {\n [Chain.Mainnet]: '0xeeda34a377dd0ca676b9511ee1324974fa8d980d',\n [Chain.Holesky]: '0x0000000000000000000000000000000000000000',\n },\n [Token.pufETH]: {\n [Chain.Mainnet]: '0xd9a442856c234a39a81a089c06451ebaa4306a72',\n [Chain.Holesky]: '0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9',\n },\n [Token.WBTC]: {\n [Chain.Mainnet]: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',\n [Chain.Holesky]: '0x0000000000000000000000000000000000000000',\n },\n [Token.LBTC]: {\n [Chain.Mainnet]: '0x8236a87084f8b84306f72007f36f2618a5634494',\n [Chain.Holesky]: '0x0000000000000000000000000000000000000000',\n },\n [Token.tBTC]: {\n [Chain.Mainnet]: '0x18084fbA666a33d37592fA2633fD49a74DD93a88',\n [Chain.Holesky]: '0x0000000000000000000000000000000000000000',\n },\n [Token.cbBTC]: {\n [Chain.Mainnet]: '0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf',\n [Chain.Holesky]: '0x0000000000000000000000000000000000000000',\n },\n\n // UniFi Tokens\n [UnifiToken.unifiETH]: {\n [Chain.Mainnet]: '0x196ead472583bc1e9af7a05f860d9857e1bd3dcc',\n [Chain.Holesky]: '0x0000000000000000000000000000000000000000',\n },\n [UnifiToken.unifiUSD]: {\n [Chain.Mainnet]: '0x82c40e07277eBb92935f79cE92268F80dDc7caB4',\n [Chain.Holesky]: '0x0000000000000000000000000000000000000000',\n },\n [UnifiToken.unifiBTC]: {\n [Chain.Mainnet]: '0x170d847a8320f3b6a77ee15b0cae430e3ec933a0',\n [Chain.Holesky]: '0x0000000000000000000000000000000000000000',\n },\n};\n\nexport const TOKENS_PERMIT_VERSION: { [key in AnyToken]: string } = {\n [Token.USDT]: '2',\n // USDC does not support permit signatures (ERC20Permit).\n [Token.USDC]: '',\n // DAI does not support permit signatures (ERC20Permit).\n [Token.DAI]: '',\n // WETH does not support permit signatures (ERC20Permit).\n [Token.WETH]: '',\n [Token.stETH]: '2',\n // Puffer Quest v1 uses version 1 for wstETH.\n [Token.wstETH]: '1',\n [Token.ALT]: '1',\n // https://github.com/etherfi-protocol/smart-contracts/blob/7c66e571df4fe7ec502a3c325b623bc52349ef9d/src/EETH.sol#L55\n [Token.eETH]: '1',\n [Token.pufETHwstE]: 'v7.0.0',\n [Token.pufETH]: '1',\n [Token.WBTC]: '',\n [Token.LBTC]: '',\n [Token.tBTC]: '',\n [Token.cbBTC]: '',\n\n // UniFi Tokens\n // https://etherscan.io/address/0x196ead472583bc1e9af7a05f860d9857e1bd3dcc#code#F7#L172\n [UnifiToken.unifiETH]: '1',\n // https://etherscan.io/address/0x82c40e07277eBb92935f79cE92268F80dDc7caB4#code#F7#L172\n [UnifiToken.unifiUSD]: '1',\n // https://etherscan.io/address/0x170d847a8320f3b6a77ee15b0cae430e3ec933a0#code#F7#L172\n [UnifiToken.unifiBTC]: '1',\n};\n\nexport const TOKENS_SALT: Partial<{\n [key in AnyToken]: { [chain in Chain]: Address };\n}> = {\n [Token.pufETHwstE]: {\n // Taken from\n // https://etherscan.io/token/0xeeda34a377dd0ca676b9511ee1324974fa8d980d#readContract#F39.\n [Chain.Mainnet]:\n '0x0e986ed5610121905f03fd3850cebcc00f66166fc3ab760acb4e087d735d9457',\n [Chain.Holesky]:\n '0x0000000000000000000000000000000000000000000000000000000000000000',\n },\n};\n"],"names":["Token","UnifiToken","TOKENS_ADDRESSES","Chain","TOKENS_PERMIT_VERSION","TOKENS_SALT"],"mappings":"6HAGY,IAAAA,GAAAA,IACVA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,IAAM,MACNA,EAAA,KAAO,OACPA,EAAA,MAAQ,QACRA,EAAA,OAAS,SACTA,EAAA,IAAM,MACNA,EAAA,KAAO,OACPA,EAAA,WAAa,aACbA,EAAA,OAAS,SACTA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,MAAQ,QAdEA,IAAAA,GAAA,CAAA,CAAA,EAiBAC,GAAAA,IACVA,EAAA,SAAW,WACXA,EAAA,SAAW,WACXA,EAAA,SAAW,WAHDA,IAAAA,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OAAO,EAAG,4CACnB,EACC,MAAc,CACb,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CACnB,EAGC,SAAsB,CACrB,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CACnB,EACC,SAAsB,CACrB,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CACnB,EACC,SAAsB,CACrB,CAACA,EAAAA,MAAM,OAAO,EAAG,6CACjB,CAACA,EAAAA,MAAM,OAAO,EAAG,4CAAA,CAErB,EAEaC,EAAuD,CACjE,KAAa,IAEb,KAAa,GAEb,IAAY,GAEZ,KAAa,GACb,MAAc,IAEd,OAAe,IACf,IAAY,IAEZ,KAAa,IACb,WAAmB,SACnB,OAAe,IACf,KAAa,GACb,KAAa,GACb,KAAa,GACb,MAAc,GAId,SAAsB,IAEtB,SAAsB,IAEtB,SAAsB,GACzB,EAEaC,EAER,CACF,WAAmB,CAGlB,CAACF,EAAAA,MAAM,OAAO,EACZ,qEACF,CAACA,EAAAA,MAAM,OAAO,EACZ,oEAAA,CAEN"}
@@ -10,10 +10,16 @@ export declare enum Token {
10
10
  ALT = "ALT",
11
11
  eETH = "eETH",
12
12
  pufETHwstE = "pufETHwstE",
13
- pufETH = "pufETH"
13
+ pufETH = "pufETH",
14
+ WBTC = "WBTC",
15
+ LBTC = "LBTC",
16
+ tBTC = "tBTC",
17
+ cbBTC = "cbBTC"
14
18
  }
15
19
  export declare enum UnifiToken {
16
- unifiETH = "unifiETH"
20
+ unifiETH = "unifiETH",
21
+ unifiUSD = "unifiUSD",
22
+ unifiBTC = "unifiBTC"
17
23
  }
18
24
  export type AnyToken = Token | UnifiToken;
19
25
  export declare const TOKENS_ADDRESSES: {
@@ -1,6 +1,6 @@
1
1
  import { C as e } from "../constants-BjRNQpT2.js";
2
- var c = /* @__PURE__ */ ((a) => (a.USDT = "USDT", a.USDC = "USDC", a.DAI = "DAI", a.WETH = "WETH", a.stETH = "stETH", a.wstETH = "wstETH", a.ALT = "ALT", a.eETH = "eETH", a.pufETHwstE = "pufETHwstE", a.pufETH = "pufETH", a))(c || {}), E = /* @__PURE__ */ ((a) => (a.unifiETH = "unifiETH", a))(E || {});
3
- const f = {
2
+ var c = /* @__PURE__ */ ((a) => (a.USDT = "USDT", a.USDC = "USDC", a.DAI = "DAI", a.WETH = "WETH", a.stETH = "stETH", a.wstETH = "wstETH", a.ALT = "ALT", a.eETH = "eETH", a.pufETHwstE = "pufETHwstE", a.pufETH = "pufETH", a.WBTC = "WBTC", a.LBTC = "LBTC", a.tBTC = "tBTC", a.cbBTC = "cbBTC", a))(c || {}), f = /* @__PURE__ */ ((a) => (a.unifiETH = "unifiETH", a.unifiUSD = "unifiUSD", a.unifiBTC = "unifiBTC", a))(f || {});
3
+ const d = {
4
4
  USDT: {
5
5
  [e.Mainnet]: "0xdac17f958d2ee523a2206206994597c13d831ec7",
6
6
  [e.Holesky]: "0xd5bef2c64f418fd460319521d37862327122e3bc"
@@ -41,14 +41,36 @@ const f = {
41
41
  [e.Mainnet]: "0xd9a442856c234a39a81a089c06451ebaa4306a72",
42
42
  [e.Holesky]: "0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9"
43
43
  },
44
- // TODO: Update the addresses once the contracts are deployed on chain.
45
- // See https://dev.azure.com/pufferfi/Frontend/_workitems/edit/1797.
44
+ WBTC: {
45
+ [e.Mainnet]: "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599",
46
+ [e.Holesky]: "0x0000000000000000000000000000000000000000"
47
+ },
48
+ LBTC: {
49
+ [e.Mainnet]: "0x8236a87084f8b84306f72007f36f2618a5634494",
50
+ [e.Holesky]: "0x0000000000000000000000000000000000000000"
51
+ },
52
+ tBTC: {
53
+ [e.Mainnet]: "0x18084fbA666a33d37592fA2633fD49a74DD93a88",
54
+ [e.Holesky]: "0x0000000000000000000000000000000000000000"
55
+ },
56
+ cbBTC: {
57
+ [e.Mainnet]: "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
58
+ [e.Holesky]: "0x0000000000000000000000000000000000000000"
59
+ },
46
60
  // UniFi Tokens
47
61
  unifiETH: {
48
62
  [e.Mainnet]: "0x196ead472583bc1e9af7a05f860d9857e1bd3dcc",
49
63
  [e.Holesky]: "0x0000000000000000000000000000000000000000"
64
+ },
65
+ unifiUSD: {
66
+ [e.Mainnet]: "0x82c40e07277eBb92935f79cE92268F80dDc7caB4",
67
+ [e.Holesky]: "0x0000000000000000000000000000000000000000"
68
+ },
69
+ unifiBTC: {
70
+ [e.Mainnet]: "0x170d847a8320f3b6a77ee15b0cae430e3ec933a0",
71
+ [e.Holesky]: "0x0000000000000000000000000000000000000000"
50
72
  }
51
- }, b = {
73
+ }, E = {
52
74
  USDT: "2",
53
75
  // USDC does not support permit signatures (ERC20Permit).
54
76
  USDC: "",
@@ -64,9 +86,17 @@ const f = {
64
86
  eETH: "1",
65
87
  pufETHwstE: "v7.0.0",
66
88
  pufETH: "1",
89
+ WBTC: "",
90
+ LBTC: "",
91
+ tBTC: "",
92
+ cbBTC: "",
67
93
  // UniFi Tokens
68
94
  // https://etherscan.io/address/0x196ead472583bc1e9af7a05f860d9857e1bd3dcc#code#F7#L172
69
- unifiETH: "1"
95
+ unifiETH: "1",
96
+ // https://etherscan.io/address/0x82c40e07277eBb92935f79cE92268F80dDc7caB4#code#F7#L172
97
+ unifiUSD: "1",
98
+ // https://etherscan.io/address/0x170d847a8320f3b6a77ee15b0cae430e3ec933a0#code#F7#L172
99
+ unifiBTC: "1"
70
100
  }, H = {
71
101
  pufETHwstE: {
72
102
  // Taken from
@@ -76,10 +106,10 @@ const f = {
76
106
  }
77
107
  };
78
108
  export {
79
- f as TOKENS_ADDRESSES,
80
- b as TOKENS_PERMIT_VERSION,
109
+ d as TOKENS_ADDRESSES,
110
+ E as TOKENS_PERMIT_VERSION,
81
111
  H as TOKENS_SALT,
82
112
  c as Token,
83
- E as UnifiToken
113
+ f as UnifiToken
84
114
  };
85
115
  //# sourceMappingURL=tokens.js.map