@pufferfinance/puffer-sdk 1.9.1 → 1.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contracts/addresses.cjs +1 -1
- package/dist/contracts/addresses.cjs.map +1 -1
- package/dist/contracts/addresses.d.ts +26 -12
- package/dist/contracts/addresses.js +28 -11
- package/dist/contracts/addresses.js.map +1 -1
- package/dist/contracts/handlers/nucleus-accountant-handler.cjs +1 -1
- package/dist/contracts/handlers/nucleus-accountant-handler.cjs.map +1 -1
- package/dist/contracts/handlers/nucleus-accountant-handler.d.ts +10 -0
- package/dist/contracts/handlers/nucleus-accountant-handler.js +26 -11
- package/dist/contracts/handlers/nucleus-accountant-handler.js.map +1 -1
- package/dist/contracts/handlers/nucleus-atomic-queue-handler.cjs +1 -1
- package/dist/contracts/handlers/nucleus-atomic-queue-handler.cjs.map +1 -1
- package/dist/contracts/handlers/nucleus-atomic-queue-handler.js +3 -3
- package/dist/contracts/handlers/nucleus-atomic-queue-handler.js.map +1 -1
- package/dist/contracts/handlers/nucleus-boring-vault-handler.cjs +1 -1
- package/dist/contracts/handlers/nucleus-boring-vault-handler.cjs.map +1 -1
- package/dist/contracts/handlers/nucleus-boring-vault-handler.d.ts +10 -6
- package/dist/contracts/handlers/nucleus-boring-vault-handler.js +38 -34
- package/dist/contracts/handlers/nucleus-boring-vault-handler.js.map +1 -1
- package/dist/contracts/handlers/nucleus-teller-handler.cjs +1 -1
- package/dist/contracts/handlers/nucleus-teller-handler.cjs.map +1 -1
- package/dist/contracts/handlers/nucleus-teller-handler.d.ts +9 -0
- package/dist/contracts/handlers/nucleus-teller-handler.js +30 -19
- package/dist/contracts/handlers/nucleus-teller-handler.js.map +1 -1
- package/dist/contracts/tokens.cjs +1 -1
- package/dist/contracts/tokens.cjs.map +1 -1
- package/dist/contracts/tokens.d.ts +10 -2
- package/dist/contracts/tokens.js +49 -9
- package/dist/contracts/tokens.js.map +1 -1
- package/dist/main.cjs +1 -1
- package/dist/main.js +23 -22
- package/dist/utils/version.cjs +1 -1
- package/dist/utils/version.cjs.map +1 -1
- package/dist/utils/version.js +1 -1
- package/dist/utils/version.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
var u = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
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 {
|
|
7
|
-
import {
|
|
8
|
-
|
|
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,
|
|
19
|
-
|
|
20
|
-
this
|
|
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,
|
|
30
|
-
return
|
|
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,
|
|
40
|
-
return this.getContract().read.allowance([t,
|
|
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,
|
|
76
|
-
return this.getContract().write.approve([
|
|
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,
|
|
94
|
-
return { transact: () => this.getContract().write.transfer([
|
|
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([
|
|
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,
|
|
115
|
-
return { transact: () => this.getContract().write.transferFrom([
|
|
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
|
-
[
|
|
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:
|
|
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
|
-
[
|
|
145
|
-
{ account:
|
|
148
|
+
[a, i, r, s, o, h, m],
|
|
149
|
+
{ account: n, chain: this.viemChain }
|
|
146
150
|
), estimate: () => this.getContract().estimateGas.permit(
|
|
147
|
-
[
|
|
148
|
-
{ account:
|
|
151
|
+
[a, i, r, s, o, h, m],
|
|
152
|
+
{ account: n }
|
|
149
153
|
) };
|
|
150
154
|
}
|
|
151
155
|
}
|
|
152
156
|
export {
|
|
153
|
-
|
|
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 {
|
|
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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K,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
|
|
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 {
|
|
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,EA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,MAAM,kBAAkBG,EAAa,CACtD,QAAAV,EACA,MAAO,KAAK,SAAA,CACb,EAMgB,SALF,IACf,KAAK,YAAc,EAAA,YAAY,kBAAkBU,EAAa,CAC5D,QAAAV,CAAA,CACD,CAEyB,CAAA,CAqBvB,kBAAkBF,EAAiC,CAClD,KAAA,CACJ,QAAAE,EACA,aAAAW,EACA,cAAAC,EACA,YAAAV,EACA,SAAAO,EACA,EAAAD,EACA,EAAAF,EACA,EAAAC,CAAA,EACET,EAkBG,MAAA,CAAE,SAhBQ,IACf,KAAK,cAAc,MAAM,kBACvB,CAACa,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"}
|
|
@@ -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 = (
|
|
3
|
-
var m = (
|
|
4
|
-
import { V as
|
|
5
|
-
import {
|
|
6
|
-
import { NUCLEUS_TELLER_ABIS as
|
|
7
|
-
import { TOKENS_ADDRESSES as C } from "../tokens.js";
|
|
8
|
-
import { ERC20PermitHandler as
|
|
9
|
-
import { g as
|
|
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
|
|
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 =
|
|
37
|
-
return
|
|
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:
|
|
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,
|
|
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,
|
|
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
|
-
|
|
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:
|
|
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,
|
|
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,
|
|
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,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQhC,kBAAkB;AACvB,WAAO,KAAK,cAAc,KAAK,gBAAgB;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAS1C,gBAAgBE,GAAwB;AAC7C,WAAO,KAAK,YAA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AO,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,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,GACA,KAAK,QAAQI,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ACA,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
|
|
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.PUFFER="PUFFER",e.CARROT="CARROT",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"},PUFFER:{[a.Chain.Mainnet]:"0x4d1c297d39c5c1277964d0e3f8aa901493664530",[a.Chain.Holesky]:"0x0000000000000000000000000000000000000000"},CARROT:{[a.Chain.Mainnet]:"0x282a69142bac47855c3fbe1693fcc4ba3b4d5ed6",[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:"",PUFFER:"1",CARROT:"1",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
|
|
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 PUFFER = 'PUFFER',\n CARROT = 'CARROT',\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 [Token.PUFFER]: {\n [Chain.Mainnet]: '0x4d1c297d39c5c1277964d0e3f8aa901493664530',\n [Chain.Holesky]: '0x0000000000000000000000000000000000000000',\n },\n [Token.CARROT]: {\n [Chain.Mainnet]: '0x282a69142bac47855c3fbe1693fcc4ba3b4d5ed6',\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 [Token.PUFFER]: '1',\n [Token.CARROT]: '1',\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,QACRA,EAAA,OAAS,SACTA,EAAA,OAAS,SAhBCA,IAAAA,GAAA,CAAA,CAAA,EAmBAC,GAAAA,IACVA,EAAA,SAAW,WACXA,EAAA,SAAW,WACXA,EAAA,SAAW,WAHDA,IAAAA,GAAA,CAAA,CAAA,EAQL,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,C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,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,GACd,OAAe,IACf,OAAe,IAIf,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,18 @@ 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",
|
|
18
|
+
PUFFER = "PUFFER",
|
|
19
|
+
CARROT = "CARROT"
|
|
14
20
|
}
|
|
15
21
|
export declare enum UnifiToken {
|
|
16
|
-
unifiETH = "unifiETH"
|
|
22
|
+
unifiETH = "unifiETH",
|
|
23
|
+
unifiUSD = "unifiUSD",
|
|
24
|
+
unifiBTC = "unifiBTC"
|
|
17
25
|
}
|
|
18
26
|
export type AnyToken = Token | UnifiToken;
|
|
19
27
|
export declare const TOKENS_ADDRESSES: {
|
package/dist/contracts/tokens.js
CHANGED
|
@@ -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 || {}),
|
|
3
|
-
const
|
|
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.PUFFER = "PUFFER", a.CARROT = "CARROT", a))(c || {}), f = /* @__PURE__ */ ((a) => (a.unifiETH = "unifiETH", a.unifiUSD = "unifiUSD", a.unifiBTC = "unifiBTC", a))(f || {});
|
|
3
|
+
const b = {
|
|
4
4
|
USDT: {
|
|
5
5
|
[e.Mainnet]: "0xdac17f958d2ee523a2206206994597c13d831ec7",
|
|
6
6
|
[e.Holesky]: "0xd5bef2c64f418fd460319521d37862327122e3bc"
|
|
@@ -41,14 +41,44 @@ const f = {
|
|
|
41
41
|
[e.Mainnet]: "0xd9a442856c234a39a81a089c06451ebaa4306a72",
|
|
42
42
|
[e.Holesky]: "0x9196830bB4c05504E0A8475A0aD566AceEB6BeC9"
|
|
43
43
|
},
|
|
44
|
-
|
|
45
|
-
|
|
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
|
+
},
|
|
60
|
+
PUFFER: {
|
|
61
|
+
[e.Mainnet]: "0x4d1c297d39c5c1277964d0e3f8aa901493664530",
|
|
62
|
+
[e.Holesky]: "0x0000000000000000000000000000000000000000"
|
|
63
|
+
},
|
|
64
|
+
CARROT: {
|
|
65
|
+
[e.Mainnet]: "0x282a69142bac47855c3fbe1693fcc4ba3b4d5ed6",
|
|
66
|
+
[e.Holesky]: "0x0000000000000000000000000000000000000000"
|
|
67
|
+
},
|
|
46
68
|
// UniFi Tokens
|
|
47
69
|
unifiETH: {
|
|
48
70
|
[e.Mainnet]: "0x196ead472583bc1e9af7a05f860d9857e1bd3dcc",
|
|
49
71
|
[e.Holesky]: "0x0000000000000000000000000000000000000000"
|
|
72
|
+
},
|
|
73
|
+
unifiUSD: {
|
|
74
|
+
[e.Mainnet]: "0x82c40e07277eBb92935f79cE92268F80dDc7caB4",
|
|
75
|
+
[e.Holesky]: "0x0000000000000000000000000000000000000000"
|
|
76
|
+
},
|
|
77
|
+
unifiBTC: {
|
|
78
|
+
[e.Mainnet]: "0x170d847a8320f3b6a77ee15b0cae430e3ec933a0",
|
|
79
|
+
[e.Holesky]: "0x0000000000000000000000000000000000000000"
|
|
50
80
|
}
|
|
51
|
-
},
|
|
81
|
+
}, E = {
|
|
52
82
|
USDT: "2",
|
|
53
83
|
// USDC does not support permit signatures (ERC20Permit).
|
|
54
84
|
USDC: "",
|
|
@@ -64,9 +94,19 @@ const f = {
|
|
|
64
94
|
eETH: "1",
|
|
65
95
|
pufETHwstE: "v7.0.0",
|
|
66
96
|
pufETH: "1",
|
|
97
|
+
WBTC: "",
|
|
98
|
+
LBTC: "",
|
|
99
|
+
tBTC: "",
|
|
100
|
+
cbBTC: "",
|
|
101
|
+
PUFFER: "1",
|
|
102
|
+
CARROT: "1",
|
|
67
103
|
// UniFi Tokens
|
|
68
104
|
// https://etherscan.io/address/0x196ead472583bc1e9af7a05f860d9857e1bd3dcc#code#F7#L172
|
|
69
|
-
unifiETH: "1"
|
|
105
|
+
unifiETH: "1",
|
|
106
|
+
// https://etherscan.io/address/0x82c40e07277eBb92935f79cE92268F80dDc7caB4#code#F7#L172
|
|
107
|
+
unifiUSD: "1",
|
|
108
|
+
// https://etherscan.io/address/0x170d847a8320f3b6a77ee15b0cae430e3ec933a0#code#F7#L172
|
|
109
|
+
unifiBTC: "1"
|
|
70
110
|
}, H = {
|
|
71
111
|
pufETHwstE: {
|
|
72
112
|
// Taken from
|
|
@@ -76,10 +116,10 @@ const f = {
|
|
|
76
116
|
}
|
|
77
117
|
};
|
|
78
118
|
export {
|
|
79
|
-
|
|
80
|
-
|
|
119
|
+
b as TOKENS_ADDRESSES,
|
|
120
|
+
E as TOKENS_PERMIT_VERSION,
|
|
81
121
|
H as TOKENS_SALT,
|
|
82
122
|
c as Token,
|
|
83
|
-
|
|
123
|
+
f as UnifiToken
|
|
84
124
|
};
|
|
85
125
|
//# sourceMappingURL=tokens.js.map
|