@curvefi/api 2.68.29 → 2.68.31
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.
|
@@ -170,6 +170,7 @@ export declare class PoolTemplate extends CorePool {
|
|
|
170
170
|
}>;
|
|
171
171
|
_swapExpected(i: number, j: number, _amount: bigint): Promise<bigint>;
|
|
172
172
|
swapExpected(inputCoin: string | number, outputCoin: string | number, amount: number | string): Promise<string>;
|
|
173
|
+
swapExpectedBigInt(inputCoin: string | number, outputCoin: string | number, amount: bigint): Promise<bigint>;
|
|
173
174
|
_swapRequired(i: number, j: number, _amount: bigint, isUnderlying: boolean): Promise<any>;
|
|
174
175
|
swapRequired(inputCoin: string | number, outputCoin: string | number, amount: number | string): Promise<string>;
|
|
175
176
|
swapWrappedRequired(inputCoin: string | number, outputCoin: string | number, amount: number | string): Promise<string>;
|
|
@@ -183,6 +184,7 @@ export declare class PoolTemplate extends CorePool {
|
|
|
183
184
|
getSwapInfo(): Promise<ISwapMethodInfo>;
|
|
184
185
|
_swapWrappedExpected(i: number, j: number, _amount: bigint): Promise<bigint>;
|
|
185
186
|
swapWrappedExpected(inputCoin: string | number, outputCoin: string | number, amount: number | string): Promise<string>;
|
|
187
|
+
swapWrappedExpectedBigInt(inputCoin: string | number, outputCoin: string | number, amount: bigint): Promise<bigint>;
|
|
186
188
|
swapWrappedPriceImpact(inputCoin: string | number, outputCoin: string | number, amount: number | string): Promise<number>;
|
|
187
189
|
swapWrappedIsApproved(inputCoin: string | number, amount: number | string): Promise<boolean>;
|
|
188
190
|
private swapWrappedApproveEstimateGas;
|
|
@@ -1681,6 +1681,14 @@ export class PoolTemplate extends CorePool {
|
|
|
1681
1681
|
return this.curve.formatUnits(_expected, this.underlyingDecimals[j]);
|
|
1682
1682
|
});
|
|
1683
1683
|
}
|
|
1684
|
+
swapExpectedBigInt(inputCoin, outputCoin, amount) {
|
|
1685
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1686
|
+
const i = this._getCoinIdx(inputCoin);
|
|
1687
|
+
const j = this._getCoinIdx(outputCoin);
|
|
1688
|
+
const _expected = yield this._swapExpected(i, j, amount);
|
|
1689
|
+
return _expected;
|
|
1690
|
+
});
|
|
1691
|
+
}
|
|
1684
1692
|
_swapRequired(i, j, _amount, isUnderlying) {
|
|
1685
1693
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1686
1694
|
if (this.isCrypto) {
|
|
@@ -1824,6 +1832,12 @@ export class PoolTemplate extends CorePool {
|
|
|
1824
1832
|
throw Error(`swapWrappedExpected method doesn't exist for pool ${this.name} (id: ${this.name})`);
|
|
1825
1833
|
});
|
|
1826
1834
|
}
|
|
1835
|
+
// OVERRIDE
|
|
1836
|
+
swapWrappedExpectedBigInt(inputCoin, outputCoin, amount) {
|
|
1837
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1838
|
+
throw Error(`swapWrappedExpectedBigInt method doesn't exist for pool ${this.name} (id: ${this.name})`);
|
|
1839
|
+
});
|
|
1840
|
+
}
|
|
1827
1841
|
swapWrappedPriceImpact(inputCoin, outputCoin, amount) {
|
|
1828
1842
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1829
1843
|
if (this.isPlain || this.isFake) {
|
|
@@ -14,6 +14,7 @@ export declare const swapWrappedMixin: {
|
|
|
14
14
|
};
|
|
15
15
|
export declare const swapWrappedExpectedAndApproveMixin: {
|
|
16
16
|
swapWrappedExpected(this: PoolTemplate, inputCoin: string | number, outputCoin: string | number, amount: number | string): Promise<string>;
|
|
17
|
+
swapWrappedExpectedBigInt(this: PoolTemplate, inputCoin: string | number, outputCoin: string | number, amount: bigint): Promise<bigint>;
|
|
17
18
|
swapWrappedIsApproved(this: PoolTemplate, inputCoin: string | number, amount: number | string): Promise<boolean>;
|
|
18
19
|
swapWrappedApproveEstimateGas(this: PoolTemplate, inputCoin: string | number, amount: number | string): Promise<number | number[]>;
|
|
19
20
|
swapWrappedApprove(this: PoolTemplate, inputCoin: string | number, amount: number | string): Promise<string[]>;
|
|
@@ -123,6 +123,14 @@ export const swapWrappedExpectedAndApproveMixin = {
|
|
|
123
123
|
return this.curve.formatUnits(_expected, this.wrappedDecimals[j]);
|
|
124
124
|
});
|
|
125
125
|
},
|
|
126
|
+
swapWrappedExpectedBigInt(inputCoin, outputCoin, amount) {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
const i = this._getCoinIdx(inputCoin, false);
|
|
129
|
+
const j = this._getCoinIdx(outputCoin, false);
|
|
130
|
+
const _expected = yield this._swapWrappedExpected.call(this, i, j, amount);
|
|
131
|
+
return _expected;
|
|
132
|
+
});
|
|
133
|
+
},
|
|
126
134
|
swapWrappedIsApproved(inputCoin, amount) {
|
|
127
135
|
return __awaiter(this, void 0, void 0, function* () {
|
|
128
136
|
const i = this._getCoinIdx.call(this, inputCoin, false);
|