@curvefi/api 2.31.0 → 2.31.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/lib/boosting.js +137 -402
- package/lib/constants/aliases.d.ts +11 -11
- package/lib/constants/aliases.js +12 -15
- package/lib/constants/coins/arbitrum.js +6 -9
- package/lib/constants/coins/aurora.js +6 -9
- package/lib/constants/coins/avalanche.js +7 -10
- package/lib/constants/coins/celo.js +6 -9
- package/lib/constants/coins/ethereum.js +10 -13
- package/lib/constants/coins/fantom.js +8 -11
- package/lib/constants/coins/kava.js +6 -9
- package/lib/constants/coins/moonbeam.js +6 -9
- package/lib/constants/coins/optimism.js +6 -9
- package/lib/constants/coins/polygon.js +7 -10
- package/lib/constants/coins/xdai.js +6 -9
- package/lib/constants/pools/arbitrum.d.ts +2 -4
- package/lib/constants/pools/arbitrum.js +22 -28
- package/lib/constants/pools/aurora.d.ts +2 -4
- package/lib/constants/pools/aurora.js +6 -12
- package/lib/constants/pools/avalanche.d.ts +2 -4
- package/lib/constants/pools/avalanche.js +21 -27
- package/lib/constants/pools/celo.d.ts +2 -4
- package/lib/constants/pools/celo.js +2 -5
- package/lib/constants/pools/ethereum.js +247 -253
- package/lib/constants/pools/fantom.d.ts +2 -4
- package/lib/constants/pools/fantom.js +28 -34
- package/lib/constants/pools/index.d.ts +11 -11
- package/lib/constants/pools/index.js +12 -25
- package/lib/constants/pools/kava.d.ts +2 -4
- package/lib/constants/pools/kava.js +2 -5
- package/lib/constants/pools/moonbeam.d.ts +2 -4
- package/lib/constants/pools/moonbeam.js +6 -12
- package/lib/constants/pools/optimism.d.ts +2 -4
- package/lib/constants/pools/optimism.js +9 -15
- package/lib/constants/pools/polygon.d.ts +2 -4
- package/lib/constants/pools/polygon.js +22 -28
- package/lib/constants/pools/xdai.d.ts +2 -4
- package/lib/constants/pools/xdai.js +24 -30
- package/lib/constants/utils.js +20 -29
- package/lib/curve.d.ts +9 -7
- package/lib/curve.js +397 -615
- package/lib/external-api.d.ts +1 -1
- package/lib/external-api.js +47 -140
- package/lib/factory/common.js +6 -10
- package/lib/factory/constants-crypto.js +48 -54
- package/lib/factory/constants.js +274 -280
- package/lib/factory/deploy.d.ts +8 -8
- package/lib/factory/deploy.js +177 -347
- package/lib/factory/factory-api.js +195 -278
- package/lib/factory/factory-crypto.js +170 -323
- package/lib/factory/factory.js +195 -350
- package/lib/index.d.ts +24 -25
- package/lib/index.js +87 -143
- package/lib/interfaces.d.ts +5 -5
- package/lib/interfaces.js +1 -2
- package/lib/pools/PoolTemplate.js +1516 -2929
- package/lib/pools/index.d.ts +2 -2
- package/lib/pools/index.js +3 -7
- package/lib/pools/mixins/common.d.ts +3 -4
- package/lib/pools/mixins/common.js +23 -112
- package/lib/pools/mixins/depositBalancedAmountsMixins.d.ts +1 -1
- package/lib/pools/mixins/depositBalancedAmountsMixins.js +50 -139
- package/lib/pools/mixins/depositMixins.d.ts +1 -1
- package/lib/pools/mixins/depositMixins.js +144 -417
- package/lib/pools/mixins/depositWrappedMixins.d.ts +1 -1
- package/lib/pools/mixins/depositWrappedMixins.js +72 -227
- package/lib/pools/mixins/poolBalancesMixin.d.ts +1 -1
- package/lib/pools/mixins/poolBalancesMixin.js +25 -105
- package/lib/pools/mixins/swapMixins.d.ts +1 -1
- package/lib/pools/mixins/swapMixins.js +127 -353
- package/lib/pools/mixins/swapWrappedMixins.d.ts +1 -1
- package/lib/pools/mixins/swapWrappedMixins.js +90 -276
- package/lib/pools/mixins/withdrawExpectedMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawExpectedMixins.js +26 -110
- package/lib/pools/mixins/withdrawImbalanceMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawImbalanceMixins.js +99 -321
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawImbalanceWrappedMixins.js +53 -192
- package/lib/pools/mixins/withdrawMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawMixins.js +123 -390
- package/lib/pools/mixins/withdrawOneCoinExpectedMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawOneCoinExpectedMixins.js +17 -92
- package/lib/pools/mixins/withdrawOneCoinMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawOneCoinMixins.js +124 -390
- package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawOneCoinWrappedExpectedMixins.js +9 -66
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawOneCoinWrappedMixins.js +55 -190
- package/lib/pools/mixins/withdrawWrappedMixins.d.ts +1 -1
- package/lib/pools/mixins/withdrawWrappedMixins.js +52 -191
- package/lib/pools/poolConstructor.d.ts +1 -1
- package/lib/pools/poolConstructor.js +77 -101
- package/lib/pools/utils.js +298 -500
- package/lib/router.d.ts +2 -2
- package/lib/router.js +390 -653
- package/lib/utils.d.ts +9 -9
- package/lib/utils.js +377 -731
- package/package.json +8 -8
|
@@ -1,235 +1,211 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var depositBalancedAmountsMixins_1 = require("./mixins/depositBalancedAmountsMixins");
|
|
23
|
-
var depositMixins_1 = require("./mixins/depositMixins");
|
|
24
|
-
var depositWrappedMixins_1 = require("./mixins/depositWrappedMixins");
|
|
25
|
-
var withdrawExpectedMixins_1 = require("./mixins/withdrawExpectedMixins");
|
|
26
|
-
var withdrawMixins_1 = require("./mixins/withdrawMixins");
|
|
27
|
-
var withdrawWrappedMixins_1 = require("./mixins/withdrawWrappedMixins");
|
|
28
|
-
var withdrawImbalanceMixins_1 = require("./mixins/withdrawImbalanceMixins");
|
|
29
|
-
var withdrawImbalanceWrappedMixins_1 = require("./mixins/withdrawImbalanceWrappedMixins");
|
|
30
|
-
var withdrawOneCoinExpectedMixins_1 = require("./mixins/withdrawOneCoinExpectedMixins");
|
|
31
|
-
var withdrawOneCoinMixins_1 = require("./mixins/withdrawOneCoinMixins");
|
|
32
|
-
var withdrawOneCoinWrappedExpectedMixins_1 = require("./mixins/withdrawOneCoinWrappedExpectedMixins");
|
|
33
|
-
var withdrawOneCoinWrappedMixins_1 = require("./mixins/withdrawOneCoinWrappedMixins");
|
|
34
|
-
var swapMixins_1 = require("./mixins/swapMixins");
|
|
35
|
-
var swapWrappedMixins_1 = require("./mixins/swapWrappedMixins");
|
|
36
|
-
var getPool = function (poolId) {
|
|
37
|
-
var poolDummy = new PoolTemplate_1.PoolTemplate(poolId);
|
|
38
|
-
var Pool = /** @class */ (function (_super) {
|
|
39
|
-
__extends(Pool, _super);
|
|
40
|
-
function Pool() {
|
|
41
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
42
|
-
}
|
|
43
|
-
return Pool;
|
|
44
|
-
}(PoolTemplate_1.PoolTemplate));
|
|
1
|
+
import { curve } from "../curve.js";
|
|
2
|
+
import { PoolTemplate } from "./PoolTemplate.js";
|
|
3
|
+
import { poolBalancesMetaMixin, poolBalancesLendingMixin } from "./mixins/poolBalancesMixin.js";
|
|
4
|
+
import { depositBalancedAmountsMixin, depositBalancedAmountsCryptoMixin, depositWrappedBalancedAmountsMixin, depositWrappedBalancedAmountsCryptoMixin } from "./mixins/depositBalancedAmountsMixins.js";
|
|
5
|
+
import { depositMetaFactoryMixin, depositCryptoMetaFactoryMixin, depositZapMixin, depositLendingOrCryptoMixin, depositPlainMixin } from "./mixins/depositMixins.js";
|
|
6
|
+
import { depositWrapped2argsMixin, depositWrapped3argsMixin } from "./mixins/depositWrappedMixins.js";
|
|
7
|
+
import { withdrawExpectedMixin, withdrawExpectedLendingOrCryptoMixin, withdrawExpectedMetaMixin, withdrawWrappedExpectedMixin } from "./mixins/withdrawExpectedMixins.js";
|
|
8
|
+
import { withdrawMetaFactoryMixin, withdrawCryptoMetaFactoryMixin, withdrawZapMixin, withdrawLendingOrCryptoMixin, withdrawPlainMixin } from "./mixins/withdrawMixins.js";
|
|
9
|
+
import { withdrawWrapped2argsMixin, withdrawWrapped3argsMixin } from "./mixins/withdrawWrappedMixins.js";
|
|
10
|
+
import { withdrawImbalanceMetaFactoryMixin, withdrawImbalanceZapMixin, withdrawImbalanceLendingMixin, withdrawImbalancePlainMixin } from "./mixins/withdrawImbalanceMixins.js";
|
|
11
|
+
import { withdrawImbalanceWrapped2argsMixin, withdrawImbalanceWrapped3argsMixin } from "./mixins/withdrawImbalanceWrappedMixins.js";
|
|
12
|
+
import { withdrawOneCoinExpectedMetaFactoryMixin, withdrawOneCoinExpectedZapMixin, withdrawOneCoinExpected3argsMixin, withdrawOneCoinExpected2argsMixin } from "./mixins/withdrawOneCoinExpectedMixins.js";
|
|
13
|
+
import { withdrawOneCoinMetaFactoryMixin, withdrawOneCoinCryptoMetaFactoryMixin, withdrawOneCoinZapMixin, withdrawOneCoinLendingOrCryptoMixin, withdrawOneCoinPlainMixin } from "./mixins/withdrawOneCoinMixins.js";
|
|
14
|
+
import { withdrawOneCoinWrappedExpected2argsMixin, withdrawOneCoinWrappedExpected3argsMixin } from "./mixins/withdrawOneCoinWrappedExpectedMixins.js";
|
|
15
|
+
import { withdrawOneCoinWrappedLendingOrCryptoMixin, withdrawOneCoinWrappedMixin } from "./mixins/withdrawOneCoinWrappedMixins.js";
|
|
16
|
+
import { swapTricrypto2Mixin, swapMetaFactoryMixin, swapCryptoMetaFactoryMixin, swapMixin } from "./mixins/swapMixins.js";
|
|
17
|
+
import { swapWrappedExpectedAndApproveMixin, swapWrappedTricrypto2Mixin, swapWrappedMixin } from "./mixins/swapWrappedMixins.js";
|
|
18
|
+
export const getPool = (poolId) => {
|
|
19
|
+
const poolDummy = new PoolTemplate(poolId);
|
|
20
|
+
class Pool extends PoolTemplate {
|
|
21
|
+
}
|
|
45
22
|
// statsBalances
|
|
46
23
|
if (poolDummy.isMeta) {
|
|
47
|
-
Object.assign(Pool.prototype,
|
|
24
|
+
Object.assign(Pool.prototype, poolBalancesMetaMixin);
|
|
48
25
|
}
|
|
49
|
-
else if (poolDummy.useLending.reduce(
|
|
50
|
-
Object.assign(Pool.prototype,
|
|
26
|
+
else if (poolDummy.useLending.reduce((x, y) => x || y)) {
|
|
27
|
+
Object.assign(Pool.prototype, poolBalancesLendingMixin);
|
|
51
28
|
}
|
|
52
29
|
// depositBalancedAmounts
|
|
53
30
|
if (poolDummy.isCrypto) {
|
|
54
|
-
Object.assign(Pool.prototype,
|
|
31
|
+
Object.assign(Pool.prototype, depositBalancedAmountsCryptoMixin);
|
|
55
32
|
}
|
|
56
33
|
else {
|
|
57
|
-
Object.assign(Pool.prototype,
|
|
34
|
+
Object.assign(Pool.prototype, depositBalancedAmountsMixin);
|
|
58
35
|
}
|
|
59
36
|
// depositWrappedBalancedAmounts
|
|
60
37
|
if (!poolDummy.isPlain && !poolDummy.isFake) {
|
|
61
38
|
if (poolDummy.isCrypto) {
|
|
62
|
-
Object.assign(Pool.prototype,
|
|
39
|
+
Object.assign(Pool.prototype, depositWrappedBalancedAmountsCryptoMixin);
|
|
63
40
|
}
|
|
64
41
|
else {
|
|
65
|
-
Object.assign(Pool.prototype,
|
|
42
|
+
Object.assign(Pool.prototype, depositWrappedBalancedAmountsMixin);
|
|
66
43
|
}
|
|
67
44
|
}
|
|
68
45
|
// deposit and depositEstimateGas
|
|
69
46
|
if (poolDummy.isMetaFactory) {
|
|
70
47
|
if (poolDummy.isCrypto) {
|
|
71
|
-
Object.assign(Pool.prototype,
|
|
48
|
+
Object.assign(Pool.prototype, depositCryptoMetaFactoryMixin);
|
|
72
49
|
}
|
|
73
50
|
else {
|
|
74
|
-
Object.assign(Pool.prototype,
|
|
51
|
+
Object.assign(Pool.prototype, depositMetaFactoryMixin);
|
|
75
52
|
}
|
|
76
53
|
}
|
|
77
54
|
else if (poolDummy.zap && poolId !== 'susd') {
|
|
78
|
-
Object.assign(Pool.prototype,
|
|
55
|
+
Object.assign(Pool.prototype, depositZapMixin);
|
|
79
56
|
}
|
|
80
57
|
else if (poolDummy.isLending || (poolDummy.isCrypto && !poolDummy.isPlain)) {
|
|
81
|
-
Object.assign(Pool.prototype,
|
|
58
|
+
Object.assign(Pool.prototype, depositLendingOrCryptoMixin);
|
|
82
59
|
}
|
|
83
60
|
else {
|
|
84
|
-
Object.assign(Pool.prototype,
|
|
61
|
+
Object.assign(Pool.prototype, depositPlainMixin);
|
|
85
62
|
}
|
|
86
63
|
// depositWrapped and depositWrappedEstimateGas
|
|
87
64
|
if (!poolDummy.isPlain && !poolDummy.isFake) {
|
|
88
65
|
if (((poolDummy.isLending || poolDummy.isCrypto) && !poolDummy.zap) || (poolDummy.isCrypto && poolDummy.isMetaFactory)) {
|
|
89
|
-
Object.assign(Pool.prototype,
|
|
66
|
+
Object.assign(Pool.prototype, depositWrapped3argsMixin);
|
|
90
67
|
}
|
|
91
68
|
else {
|
|
92
|
-
Object.assign(Pool.prototype,
|
|
69
|
+
Object.assign(Pool.prototype, depositWrapped2argsMixin);
|
|
93
70
|
}
|
|
94
71
|
}
|
|
95
72
|
// withdrawExpected
|
|
96
73
|
if (poolDummy.isMeta) {
|
|
97
|
-
Object.assign(Pool.prototype,
|
|
74
|
+
Object.assign(Pool.prototype, withdrawExpectedMetaMixin);
|
|
98
75
|
}
|
|
99
76
|
else if (poolDummy.isLending || (poolDummy.isCrypto && !poolDummy.isPlain)) {
|
|
100
|
-
Object.assign(Pool.prototype,
|
|
77
|
+
Object.assign(Pool.prototype, withdrawExpectedLendingOrCryptoMixin);
|
|
101
78
|
}
|
|
102
79
|
else {
|
|
103
|
-
Object.assign(Pool.prototype,
|
|
80
|
+
Object.assign(Pool.prototype, withdrawExpectedMixin);
|
|
104
81
|
}
|
|
105
82
|
// withdraw and withdrawEstimateGas
|
|
106
83
|
if (poolDummy.isMetaFactory) {
|
|
107
84
|
if (poolDummy.isCrypto) {
|
|
108
|
-
Object.assign(Pool.prototype,
|
|
85
|
+
Object.assign(Pool.prototype, withdrawCryptoMetaFactoryMixin);
|
|
109
86
|
}
|
|
110
87
|
else {
|
|
111
|
-
Object.assign(Pool.prototype,
|
|
88
|
+
Object.assign(Pool.prototype, withdrawMetaFactoryMixin);
|
|
112
89
|
}
|
|
113
90
|
}
|
|
114
91
|
else if (poolDummy.zap && poolId !== 'susd') {
|
|
115
|
-
Object.assign(Pool.prototype,
|
|
92
|
+
Object.assign(Pool.prototype, withdrawZapMixin);
|
|
116
93
|
}
|
|
117
94
|
else if (poolDummy.isLending || (poolDummy.isCrypto && !poolDummy.isPlain)) {
|
|
118
|
-
Object.assign(Pool.prototype,
|
|
95
|
+
Object.assign(Pool.prototype, withdrawLendingOrCryptoMixin);
|
|
119
96
|
}
|
|
120
97
|
else {
|
|
121
|
-
Object.assign(Pool.prototype,
|
|
98
|
+
Object.assign(Pool.prototype, withdrawPlainMixin);
|
|
122
99
|
}
|
|
123
100
|
// withdrawWrapped and withdrawWrappedEstimateGas
|
|
124
101
|
if (!poolDummy.isPlain && !poolDummy.isFake) {
|
|
125
102
|
if (((poolDummy.isLending || poolDummy.isCrypto) && !poolDummy.zap) || (poolDummy.isCrypto && poolDummy.isMetaFactory)) {
|
|
126
|
-
Object.assign(Pool.prototype,
|
|
127
|
-
Object.assign(Pool.prototype,
|
|
103
|
+
Object.assign(Pool.prototype, withdrawWrapped3argsMixin);
|
|
104
|
+
Object.assign(Pool.prototype, withdrawWrappedExpectedMixin);
|
|
128
105
|
}
|
|
129
106
|
else {
|
|
130
|
-
Object.assign(Pool.prototype,
|
|
131
|
-
Object.assign(Pool.prototype,
|
|
107
|
+
Object.assign(Pool.prototype, withdrawWrapped2argsMixin);
|
|
108
|
+
Object.assign(Pool.prototype, withdrawWrappedExpectedMixin);
|
|
132
109
|
}
|
|
133
110
|
}
|
|
134
111
|
// withdrawImbalance and withdrawImbalanceEstimateGas
|
|
135
112
|
if (!poolDummy.isCrypto) {
|
|
136
113
|
if (poolDummy.isMetaFactory) {
|
|
137
|
-
Object.assign(Pool.prototype,
|
|
114
|
+
Object.assign(Pool.prototype, withdrawImbalanceMetaFactoryMixin);
|
|
138
115
|
}
|
|
139
116
|
else if (poolDummy.zap && poolId !== 'susd') {
|
|
140
|
-
Object.assign(Pool.prototype,
|
|
117
|
+
Object.assign(Pool.prototype, withdrawImbalanceZapMixin);
|
|
141
118
|
}
|
|
142
119
|
else if (poolDummy.isLending) {
|
|
143
|
-
Object.assign(Pool.prototype,
|
|
120
|
+
Object.assign(Pool.prototype, withdrawImbalanceLendingMixin);
|
|
144
121
|
}
|
|
145
122
|
else {
|
|
146
|
-
Object.assign(Pool.prototype,
|
|
123
|
+
Object.assign(Pool.prototype, withdrawImbalancePlainMixin);
|
|
147
124
|
}
|
|
148
125
|
}
|
|
149
126
|
// withdrawImbalanceWrapped and withdrawImbalanceWrappedEstimateGas
|
|
150
127
|
if (!poolDummy.isCrypto) {
|
|
151
128
|
if (poolDummy.isLending && !poolDummy.zap) {
|
|
152
|
-
Object.assign(Pool.prototype,
|
|
129
|
+
Object.assign(Pool.prototype, withdrawImbalanceWrapped3argsMixin);
|
|
153
130
|
}
|
|
154
131
|
else if (!poolDummy.isPlain && !poolDummy.isFake) {
|
|
155
|
-
Object.assign(Pool.prototype,
|
|
132
|
+
Object.assign(Pool.prototype, withdrawImbalanceWrapped2argsMixin);
|
|
156
133
|
}
|
|
157
134
|
}
|
|
158
135
|
// withdrawOneCoinExpected
|
|
159
136
|
if (poolDummy.isMetaFactory) {
|
|
160
|
-
Object.assign(Pool.prototype,
|
|
137
|
+
Object.assign(Pool.prototype, withdrawOneCoinExpectedMetaFactoryMixin);
|
|
161
138
|
}
|
|
162
139
|
else if ((!poolDummy.isCrypto && poolDummy.zap) || poolDummy.isMeta) { // including susd
|
|
163
|
-
Object.assign(Pool.prototype,
|
|
140
|
+
Object.assign(Pool.prototype, withdrawOneCoinExpectedZapMixin);
|
|
164
141
|
}
|
|
165
142
|
else if (poolId === 'ib') {
|
|
166
|
-
Object.assign(Pool.prototype,
|
|
143
|
+
Object.assign(Pool.prototype, withdrawOneCoinExpected3argsMixin);
|
|
167
144
|
}
|
|
168
145
|
else {
|
|
169
|
-
Object.assign(Pool.prototype,
|
|
146
|
+
Object.assign(Pool.prototype, withdrawOneCoinExpected2argsMixin);
|
|
170
147
|
}
|
|
171
148
|
// withdrawOneCoin and withdrawOneCoinEstimateGas
|
|
172
149
|
if (poolDummy.isMetaFactory) {
|
|
173
150
|
if (poolDummy.isCrypto) {
|
|
174
|
-
Object.assign(Pool.prototype,
|
|
151
|
+
Object.assign(Pool.prototype, withdrawOneCoinCryptoMetaFactoryMixin);
|
|
175
152
|
}
|
|
176
153
|
else {
|
|
177
|
-
Object.assign(Pool.prototype,
|
|
154
|
+
Object.assign(Pool.prototype, withdrawOneCoinMetaFactoryMixin);
|
|
178
155
|
}
|
|
179
156
|
}
|
|
180
157
|
else if (poolDummy.zap) { // including susd
|
|
181
|
-
Object.assign(Pool.prototype,
|
|
158
|
+
Object.assign(Pool.prototype, withdrawOneCoinZapMixin);
|
|
182
159
|
}
|
|
183
160
|
else if (poolDummy.isLending || (poolDummy.isCrypto && !poolDummy.isPlain)) {
|
|
184
|
-
Object.assign(Pool.prototype,
|
|
161
|
+
Object.assign(Pool.prototype, withdrawOneCoinLendingOrCryptoMixin);
|
|
185
162
|
}
|
|
186
163
|
else {
|
|
187
|
-
Object.assign(Pool.prototype,
|
|
164
|
+
Object.assign(Pool.prototype, withdrawOneCoinPlainMixin);
|
|
188
165
|
}
|
|
189
166
|
// withdrawOneCoinWrappedExpected
|
|
190
167
|
if (!poolDummy.isPlain && !poolDummy.isFake && !(poolDummy.isLending && poolDummy.zap)) {
|
|
191
168
|
if (poolId === "ib") {
|
|
192
|
-
Object.assign(Pool.prototype,
|
|
169
|
+
Object.assign(Pool.prototype, withdrawOneCoinWrappedExpected3argsMixin);
|
|
193
170
|
}
|
|
194
171
|
else {
|
|
195
|
-
Object.assign(Pool.prototype,
|
|
172
|
+
Object.assign(Pool.prototype, withdrawOneCoinWrappedExpected2argsMixin);
|
|
196
173
|
}
|
|
197
174
|
}
|
|
198
175
|
// withdrawOneCoinWrapped and withdrawOneCoinWrappedEstimateGas
|
|
199
176
|
if (!poolDummy.isPlain && !poolDummy.isFake && !(poolDummy.isLending && poolDummy.zap)) {
|
|
200
177
|
if (((poolDummy.isLending || poolDummy.isCrypto) && !poolDummy.zap) || (poolDummy.isCrypto && poolDummy.isMetaFactory)) {
|
|
201
|
-
Object.assign(Pool.prototype,
|
|
178
|
+
Object.assign(Pool.prototype, withdrawOneCoinWrappedLendingOrCryptoMixin);
|
|
202
179
|
}
|
|
203
180
|
else {
|
|
204
|
-
Object.assign(Pool.prototype,
|
|
181
|
+
Object.assign(Pool.prototype, withdrawOneCoinWrappedMixin);
|
|
205
182
|
}
|
|
206
183
|
}
|
|
207
184
|
// swap and swapEstimateGas
|
|
208
|
-
if ('exchange(uint256,uint256,uint256,uint256,bool)' in
|
|
209
|
-
!(
|
|
210
|
-
Object.assign(Pool.prototype,
|
|
185
|
+
if ('exchange(uint256,uint256,uint256,uint256,bool)' in curve.contracts[poolDummy.address].contract &&
|
|
186
|
+
!(curve.chainId === 100 && poolDummy.id === "tricrypto")) { // tricrypto2 (eth), tricrypto (arbitrum), avaxcrypto (avalanche); 100 is xDAI
|
|
187
|
+
Object.assign(Pool.prototype, swapTricrypto2Mixin);
|
|
211
188
|
}
|
|
212
|
-
else if (poolDummy.isMetaFactory && (
|
|
189
|
+
else if (poolDummy.isMetaFactory && (getPool(poolDummy.basePool).isLending || getPool(poolDummy.basePool).isFake || poolDummy.isCrypto)) {
|
|
213
190
|
if (poolDummy.isCrypto) {
|
|
214
|
-
Object.assign(Pool.prototype,
|
|
191
|
+
Object.assign(Pool.prototype, swapCryptoMetaFactoryMixin);
|
|
215
192
|
}
|
|
216
193
|
else {
|
|
217
|
-
Object.assign(Pool.prototype,
|
|
194
|
+
Object.assign(Pool.prototype, swapMetaFactoryMixin);
|
|
218
195
|
}
|
|
219
196
|
}
|
|
220
197
|
else {
|
|
221
|
-
Object.assign(Pool.prototype,
|
|
198
|
+
Object.assign(Pool.prototype, swapMixin);
|
|
222
199
|
}
|
|
223
200
|
// swapWrapped and swapWrappedEstimateGas
|
|
224
201
|
if (!poolDummy.isPlain && !poolDummy.isFake) {
|
|
225
|
-
Object.assign(Pool.prototype,
|
|
226
|
-
if ('exchange(uint256,uint256,uint256,uint256,bool)' in
|
|
227
|
-
Object.assign(Pool.prototype,
|
|
202
|
+
Object.assign(Pool.prototype, swapWrappedExpectedAndApproveMixin);
|
|
203
|
+
if ('exchange(uint256,uint256,uint256,uint256,bool)' in curve.contracts[poolDummy.address].contract) { // tricrypto2 (eth), tricrypto (arbitrum)
|
|
204
|
+
Object.assign(Pool.prototype, swapWrappedTricrypto2Mixin);
|
|
228
205
|
}
|
|
229
206
|
else {
|
|
230
|
-
Object.assign(Pool.prototype,
|
|
207
|
+
Object.assign(Pool.prototype, swapWrappedMixin);
|
|
231
208
|
}
|
|
232
209
|
}
|
|
233
210
|
return new Pool(poolId);
|
|
234
211
|
};
|
|
235
|
-
exports.getPool = getPool;
|