@pufferfinance/puffer-sdk 1.16.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/puffer-client.cjs +1 -1
- package/dist/api/puffer-client.cjs.map +1 -1
- package/dist/api/puffer-client.d.ts +3 -0
- package/dist/api/puffer-client.js +19 -12
- package/dist/api/puffer-client.js.map +1 -1
- package/dist/contracts/abis/mainnet/ConcreteMultiStrategyVault.cjs +2 -0
- package/dist/contracts/abis/mainnet/ConcreteMultiStrategyVault.cjs.map +1 -0
- package/dist/contracts/abis/mainnet/ConcreteMultiStrategyVault.d.ts +272 -0
- package/dist/contracts/abis/mainnet/ConcreteMultiStrategyVault.js +217 -0
- package/dist/contracts/abis/mainnet/ConcreteMultiStrategyVault.js.map +1 -0
- package/dist/contracts/handlers/concrete-vault-handler.cjs +2 -0
- package/dist/contracts/handlers/concrete-vault-handler.cjs.map +1 -0
- package/dist/contracts/handlers/concrete-vault-handler.d.ts +14902 -0
- package/dist/contracts/handlers/concrete-vault-handler.js +129 -0
- package/dist/contracts/handlers/concrete-vault-handler.js.map +1 -0
- package/dist/contracts/tokens.cjs +1 -1
- package/dist/contracts/tokens.cjs.map +1 -1
- package/dist/contracts/tokens.d.ts +1 -0
- package/dist/contracts/tokens.js +5 -1
- package/dist/contracts/tokens.js.map +1 -1
- package/dist/contracts/vaults-addresses.cjs +1 -1
- package/dist/contracts/vaults-addresses.cjs.map +1 -1
- package/dist/contracts/vaults-addresses.d.ts +5 -0
- package/dist/contracts/vaults-addresses.js +12 -7
- package/dist/contracts/vaults-addresses.js.map +1 -1
- package/dist/main.cjs +1 -1
- package/dist/main.d.ts +1 -0
- package/dist/main.js +16 -14
- package/dist/main.js.map +1 -1
- package/dist/utils/version.cjs +1 -1
- package/dist/utils/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
const e = [
|
|
2
|
+
{ inputs: [], stateMutability: "nonpayable", type: "constructor" },
|
|
3
|
+
{
|
|
4
|
+
inputs: [
|
|
5
|
+
{ internalType: "address", name: "spender", type: "address" },
|
|
6
|
+
{ internalType: "uint256", name: "allowance", type: "uint256" },
|
|
7
|
+
{ internalType: "uint256", name: "needed", type: "uint256" }
|
|
8
|
+
],
|
|
9
|
+
name: "ERC20InsufficientAllowance",
|
|
10
|
+
type: "error"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
anonymous: !1,
|
|
14
|
+
inputs: [
|
|
15
|
+
{
|
|
16
|
+
indexed: !0,
|
|
17
|
+
internalType: "address",
|
|
18
|
+
name: "owner",
|
|
19
|
+
type: "address"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
indexed: !0,
|
|
23
|
+
internalType: "address",
|
|
24
|
+
name: "spender",
|
|
25
|
+
type: "address"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
indexed: !1,
|
|
29
|
+
internalType: "uint256",
|
|
30
|
+
name: "value",
|
|
31
|
+
type: "uint256"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
name: "Approval",
|
|
35
|
+
type: "event"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
anonymous: !1,
|
|
39
|
+
inputs: [
|
|
40
|
+
{
|
|
41
|
+
indexed: !0,
|
|
42
|
+
internalType: "address",
|
|
43
|
+
name: "sender",
|
|
44
|
+
type: "address"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
indexed: !0,
|
|
48
|
+
internalType: "address",
|
|
49
|
+
name: "owner",
|
|
50
|
+
type: "address"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
indexed: !1,
|
|
54
|
+
internalType: "uint256",
|
|
55
|
+
name: "assets",
|
|
56
|
+
type: "uint256"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
indexed: !1,
|
|
60
|
+
internalType: "uint256",
|
|
61
|
+
name: "shares",
|
|
62
|
+
type: "uint256"
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
name: "Deposit",
|
|
66
|
+
type: "event"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
anonymous: !1,
|
|
70
|
+
inputs: [
|
|
71
|
+
{
|
|
72
|
+
indexed: !0,
|
|
73
|
+
internalType: "address",
|
|
74
|
+
name: "from",
|
|
75
|
+
type: "address"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
indexed: !0,
|
|
79
|
+
internalType: "address",
|
|
80
|
+
name: "to",
|
|
81
|
+
type: "address"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
indexed: !1,
|
|
85
|
+
internalType: "uint256",
|
|
86
|
+
name: "value",
|
|
87
|
+
type: "uint256"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
name: "Transfer",
|
|
91
|
+
type: "event"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
anonymous: !1,
|
|
95
|
+
inputs: [
|
|
96
|
+
{
|
|
97
|
+
indexed: !0,
|
|
98
|
+
internalType: "address",
|
|
99
|
+
name: "sender",
|
|
100
|
+
type: "address"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
indexed: !0,
|
|
104
|
+
internalType: "address",
|
|
105
|
+
name: "receiver",
|
|
106
|
+
type: "address"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
indexed: !0,
|
|
110
|
+
internalType: "address",
|
|
111
|
+
name: "owner",
|
|
112
|
+
type: "address"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
indexed: !1,
|
|
116
|
+
internalType: "uint256",
|
|
117
|
+
name: "assets",
|
|
118
|
+
type: "uint256"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
indexed: !1,
|
|
122
|
+
internalType: "uint256",
|
|
123
|
+
name: "shares",
|
|
124
|
+
type: "uint256"
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
name: "Withdraw",
|
|
128
|
+
type: "event"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
inputs: [
|
|
132
|
+
{ internalType: "address", name: "owner", type: "address" },
|
|
133
|
+
{ internalType: "address", name: "spender", type: "address" }
|
|
134
|
+
],
|
|
135
|
+
name: "allowance",
|
|
136
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
137
|
+
stateMutability: "view",
|
|
138
|
+
type: "function"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
inputs: [
|
|
142
|
+
{ internalType: "address", name: "spender", type: "address" },
|
|
143
|
+
{ internalType: "uint256", name: "value", type: "uint256" }
|
|
144
|
+
],
|
|
145
|
+
name: "approve",
|
|
146
|
+
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
147
|
+
stateMutability: "nonpayable",
|
|
148
|
+
type: "function"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
inputs: [{ internalType: "address", name: "account", type: "address" }],
|
|
152
|
+
name: "balanceOf",
|
|
153
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
154
|
+
stateMutability: "view",
|
|
155
|
+
type: "function"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
inputs: [
|
|
159
|
+
{ internalType: "uint256", name: "assets_", type: "uint256" },
|
|
160
|
+
{ internalType: "address", name: "receiver_", type: "address" }
|
|
161
|
+
],
|
|
162
|
+
name: "deposit",
|
|
163
|
+
outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
|
|
164
|
+
stateMutability: "nonpayable",
|
|
165
|
+
type: "function"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
inputs: [{ internalType: "uint256", name: "assets_", type: "uint256" }],
|
|
169
|
+
name: "deposit",
|
|
170
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
171
|
+
stateMutability: "nonpayable",
|
|
172
|
+
type: "function"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
inputs: [{ internalType: "uint256", name: "assets_", type: "uint256" }],
|
|
176
|
+
name: "previewDeposit",
|
|
177
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
178
|
+
stateMutability: "view",
|
|
179
|
+
type: "function"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
inputs: [{ internalType: "uint256", name: "assets_", type: "uint256" }],
|
|
183
|
+
name: "previewWithdraw",
|
|
184
|
+
outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
|
|
185
|
+
stateMutability: "view",
|
|
186
|
+
type: "function"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
inputs: [],
|
|
190
|
+
name: "totalSupply",
|
|
191
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
192
|
+
stateMutability: "view",
|
|
193
|
+
type: "function"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
inputs: [
|
|
197
|
+
{ internalType: "uint256", name: "assets_", type: "uint256" },
|
|
198
|
+
{ internalType: "address", name: "receiver_", type: "address" },
|
|
199
|
+
{ internalType: "address", name: "owner_", type: "address" }
|
|
200
|
+
],
|
|
201
|
+
name: "withdraw",
|
|
202
|
+
outputs: [{ internalType: "uint256", name: "shares", type: "uint256" }],
|
|
203
|
+
stateMutability: "nonpayable",
|
|
204
|
+
type: "function"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
inputs: [{ internalType: "uint256", name: "assets_", type: "uint256" }],
|
|
208
|
+
name: "withdraw",
|
|
209
|
+
outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
|
|
210
|
+
stateMutability: "nonpayable",
|
|
211
|
+
type: "function"
|
|
212
|
+
}
|
|
213
|
+
];
|
|
214
|
+
export {
|
|
215
|
+
e as ConcreteMultiStrategyVault
|
|
216
|
+
};
|
|
217
|
+
//# sourceMappingURL=ConcreteMultiStrategyVault.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConcreteMultiStrategyVault.js","sources":["../../../../lib/contracts/abis/mainnet/ConcreteMultiStrategyVault.ts"],"sourcesContent":["export const ConcreteMultiStrategyVault = <const>[\n { inputs: [], stateMutability: 'nonpayable', type: 'constructor' },\n {\n inputs: [\n { internalType: 'address', name: 'spender', type: 'address' },\n { internalType: 'uint256', name: 'allowance', type: 'uint256' },\n { internalType: 'uint256', name: 'needed', type: 'uint256' },\n ],\n name: 'ERC20InsufficientAllowance',\n type: 'error',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'owner',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'spender',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'value',\n type: 'uint256',\n },\n ],\n name: 'Approval',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'sender',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'owner',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'assets',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'shares',\n type: 'uint256',\n },\n ],\n name: 'Deposit',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'from',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'to',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'value',\n type: 'uint256',\n },\n ],\n name: 'Transfer',\n type: 'event',\n },\n {\n anonymous: false,\n inputs: [\n {\n indexed: true,\n internalType: 'address',\n name: 'sender',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'receiver',\n type: 'address',\n },\n {\n indexed: true,\n internalType: 'address',\n name: 'owner',\n type: 'address',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'assets',\n type: 'uint256',\n },\n {\n indexed: false,\n internalType: 'uint256',\n name: 'shares',\n type: 'uint256',\n },\n ],\n name: 'Withdraw',\n type: 'event',\n },\n {\n inputs: [\n { internalType: 'address', name: 'owner', type: 'address' },\n { internalType: 'address', name: 'spender', type: 'address' },\n ],\n name: 'allowance',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'address', name: 'spender', type: 'address' },\n { internalType: 'uint256', name: 'value', type: 'uint256' },\n ],\n name: 'approve',\n outputs: [{ internalType: 'bool', name: '', type: 'bool' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'address', name: 'account', type: 'address' }],\n name: 'balanceOf',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'assets_', type: 'uint256' },\n { internalType: 'address', name: 'receiver_', type: 'address' },\n ],\n name: 'deposit',\n outputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'assets_', type: 'uint256' }],\n name: 'deposit',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'assets_', type: 'uint256' }],\n name: 'previewDeposit',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'assets_', type: 'uint256' }],\n name: 'previewWithdraw',\n outputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [],\n name: 'totalSupply',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'view',\n type: 'function',\n },\n {\n inputs: [\n { internalType: 'uint256', name: 'assets_', type: 'uint256' },\n { internalType: 'address', name: 'receiver_', type: 'address' },\n { internalType: 'address', name: 'owner_', type: 'address' },\n ],\n name: 'withdraw',\n outputs: [{ internalType: 'uint256', name: 'shares', type: 'uint256' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n {\n inputs: [{ internalType: 'uint256', name: 'assets_', type: 'uint256' }],\n name: 'withdraw',\n outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],\n stateMutability: 'nonpayable',\n type: 'function',\n },\n];\n"],"names":["ConcreteMultiStrategyVault"],"mappings":"AAAO,MAAMA,IAAoC;AAAA,EAC/C,EAAE,QAAQ,CAAA,GAAI,iBAAiB,cAAc,MAAM,cAAc;AAAA,EACjE;AAAA,IACE,QAAQ;AAAA,MACN,EAAE,cAAc,WAAW,MAAM,WAAW,MAAM,UAAU;AAAA,MAC5D,EAAE,cAAc,WAAW,MAAM,aAAa,MAAM,UAAU;AAAA,MAC9D,EAAE,cAAc,WAAW,MAAM,UAAU,MAAM,UAAU;AAAA,IAC7D;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,WAAW;AAAA,IACX,QAAQ;AAAA,MACN;AAAA,QACE,SAAS;AAAA,QACT,cAAc;AAAA,QACd,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,cAAc;AAAA,QACd,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,cAAc;AAAA,QACd,MAAM;AAAA,QACN,MAAM;AAAA,MAAA;AAAA,IAEV;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,WAAW;AAAA,IACX,QAAQ;AAAA,MACN;AAAA,QACE,SAAS;AAAA,QACT,cAAc;AAAA,QACd,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,cAAc;AAAA,QACd,MAAM;AAAA,QACN,MAAM;AAAA,MACR;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,cA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ACtE,MAAM;AAAA,IACN,SAAS,CAAC,EAAE,cAAc,WAAW,MAAM,IAAI,MAAM,WAAW;AAAA,IAChE,iBAAiB;AAAA,IACjB,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,QAAQ,CAAC,EAAE,cAAc,WAAW,MAAM,WAAW,MAAM,WAAW;AAAA,IACtE,MAAM;AAAA,IACN,SAAS,CAAC,EAAE,cAAc,WAAW,MAAM,UAAU,MAAM,WAAW;AAAA,IACtE,iBAAiB;AAAA,IACjB,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,QAAQ,CAAC;AAAA,IACT,MAAM;AAAA,IACN,SAAS,CAAC,EAAE,cAAc,WAAW,MAAM,IAAI,MAAM,WAAW;AAAA,IAChE,iBAAiB;AAAA,IACjB,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,QAAQ;AAAA,MACN,EAAE,cAAc,WAAW,MAAM,WAAW,MAAM,UAAU;AAAA,MAC5D,EAAE,cAAc,WAAW,MAAM,aAAa,MAAM,UAAU;AAAA,MAC9D,EAAE,cAAc,WAAW,MAAM,UAAU,MAAM,UAAU;AAAA,IAC7D;AAAA,IACA,MAAM;AAAA,IACN,SAAS,CAAC,EAAE,cAAc,WAAW,MAAM,UAAU,MAAM,WAAW;AAAA,IACtE,iBAAiB;AAAA,IACjB,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,QAAQ,CAAC,EAAE,cAAc,WAAW,MAAM,WAAW,MAAM,WAAW;AAAA,IACtE,MAAM;AAAA,IACN,SAAS,CAAC,EAAE,cAAc,WAAW,MAAM,IAAI,MAAM,WAAW;AAAA,IAChE,iBAAiB;AAAA,IACjB,MAAM;AAAA,EAAA;AAEV;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var c=(i,t,e)=>t in i?a(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var r=(i,t,e)=>c(i,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../../constants-Bsa7cnXP.cjs"),s=require("../abis/mainnet/ConcreteMultiStrategyVault.cjs"),l=require("../tokens.cjs"),h=require("../vaults-addresses.cjs"),u=require("../../getContract-Z5RjOH18.cjs");class C{constructor(t,e,n){r(this,"viemChain");r(this,"token");this.chain=t,this.walletClient=e,this.publicClient=n,this.viemChain=o.VIEM_CHAINS[t],this.token=l.Token.pufETH}withToken(t){return this.token=t,this}getContract(){const t=h.VAULTS_ADDRESSES[this.token][this.chain].ConcreteMultiStrategyVault,e=s.ConcreteMultiStrategyVault,n={public:this.publicClient,wallet:this.walletClient};return u.getContract({address:t,abi:e,client:n})}approve(t,e){return this.getContract().write.approve([t,e],{account:this.walletClient.account,chain:this.viemChain})}getAllowance(t,e){return this.getContract().read.allowance([t,e])}getBalance(t){return this.getContract().read.balanceOf([t])}getTotalSupply(){return this.getContract().read.totalSupply()}deposit(t){return this.getContract().write.deposit([t],{account:this.walletClient.account,chain:this.viemChain})}withdraw(t){return this.getContract().write.withdraw([t],{account:this.walletClient.account,chain:this.viemChain})}previewDeposit(t){return this.getContract().read.previewDeposit([t])}previewWithdraw(t){return this.getContract().read.previewWithdraw([t])}}exports.ConcreteVaultHandler=C;
|
|
2
|
+
//# sourceMappingURL=concrete-vault-handler.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concrete-vault-handler.cjs","sources":["../../../lib/contracts/handlers/concrete-vault-handler.ts"],"sourcesContent":["import {\n WalletClient,\n PublicClient,\n getContract,\n Address,\n GetContractReturnType,\n Account,\n} from 'viem';\nimport { Chain, VIEM_CHAINS, ViemChain } from '../../chains/constants';\nimport { ConcreteMultiStrategyVault } from '../abis/mainnet/ConcreteMultiStrategyVault';\nimport { Token } from '../tokens';\nimport { VAULTS_ADDRESSES } from '../vaults-addresses';\n\ntype VaultAddresses = typeof VAULTS_ADDRESSES;\ntype PufETHVault = VaultAddresses[Token.pufETH][Chain.Mainnet];\n\n/**\n * Handler for the `ConcreteMultStrategyVault` contract for a given token (pufETH) exposing\n * methods to interact with the contract.\n */\nexport class ConcreteVaultHandler {\n private viemChain: ViemChain;\n private token: Token.pufETH;\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 = Token.pufETH;\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: Token.pufETH) {\n this.token = token;\n return this;\n }\n\n /**\n * Get the contract.\n *\n * @returns The viem contract.\n */\n public getContract() {\n const address = (VAULTS_ADDRESSES[this.token][this.chain] as PufETHVault)\n .ConcreteMultiStrategyVault as Address;\n const abi = ConcreteMultiStrategyVault;\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 * Approve a spender to spend the token.\n *\n * @param spender The spender of the token.\n * @param amount The amount to approve.\n * @returns The transaction.\n */\n public approve(spender: Address, amount: bigint) {\n return this.getContract().write.approve([spender, amount], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Get the allowance of the owner for the spender.\n *\n * @param owner The owner of the allowance.\n * @param spender The spender of the allowance.\n * @returns The allowance.\n */\n public getAllowance(owner: Address, spender: Address) {\n return this.getContract().read.allowance([owner, spender]);\n }\n\n /**\n * Get the balance for the address.\n *\n * @param address The address to get the balance of.\n * @returns The balance.\n */\n public getBalance(address: Address) {\n return this.getContract().read.balanceOf([address]);\n }\n\n /**\n * Get the total supply of the token.\n *\n * @returns The total supply.\n */\n public getTotalSupply() {\n return this.getContract().read.totalSupply();\n }\n\n /**\n * Deposit an amount of the token.\n *\n * @param amount The amount to deposit.\n * @returns The transaction.\n */\n public deposit(amount: bigint) {\n return this.getContract().write.deposit([amount], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Withdraw an amount of the token.\n *\n * @param amount The amount to withdraw.\n * @returns The transaction.\n */\n public withdraw(amount: bigint) {\n return this.getContract().write.withdraw([amount], {\n account: this.walletClient.account as Account,\n chain: this.viemChain,\n });\n }\n\n /**\n * Provides a preview of the number of shares that would be minted for a given deposit amount, after fees.\n *\n * @param amount The amount to deposit.\n * @returns The preview.\n */\n public previewDeposit(amount: bigint) {\n return this.getContract().read.previewDeposit([amount]);\n }\n\n /**\n * Provides a preview of the number of shares that would be burned for a given withdrawal amount, after fees.\n *\n * @param amount The amount to withdraw.\n * @returns The preview.\n */\n public previewWithdraw(amount: bigint) {\n return this.getContract().read.previewWithdraw([amount]);\n }\n}\n"],"names":["ConcreteVaultHandler","chain","walletClient","publicClient","__publicField","VIEM_CHAINS","Token","token","address","VAULTS_ADDRESSES","abi","ConcreteMultiStrategyVault","client","getContract","spender","amount","owner"],"mappings":"4cAoBO,MAAMA,CAAqB,CAahC,YACUC,EACAC,EACAC,EACR,CAhBMC,EAAA,kBACAA,EAAA,cAYE,KAAA,MAAAH,EACA,KAAA,aAAAC,EACA,KAAA,aAAAC,EAEH,KAAA,UAAYE,cAAYJ,CAAK,EAClC,KAAK,MAAQK,EAAAA,MAAM,MAAA,CAUd,UAAUC,EAAqB,CACpC,YAAK,MAAQA,EACN,IAAA,CAQF,aAAc,CACnB,MAAMC,EAAWC,EAAAA,iBAAiB,KAAK,KAAK,EAAE,KAAK,KAAK,EACrD,2BACGC,EAAMC,EAAA,2BACNC,EAAS,CAAE,OAAQ,KAAK,aAAc,OAAQ,KAAK,YAAa,EAEtE,OAAOC,EAAY,YAAA,CAAE,QAAAL,EAAS,IAAAE,EAAK,OAAAE,EAAQ,CAAA,CActC,QAAQE,EAAkBC,EAAgB,CACxC,OAAA,KAA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