@myx-trade/sdk 0.1.24 → 0.1.26
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/index.js +6 -8
- package/dist/index.mjs +6 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1827,7 +1827,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
|
|
|
1827
1827
|
// package.json
|
|
1828
1828
|
var package_default = {
|
|
1829
1829
|
name: "@myx-trade/sdk",
|
|
1830
|
-
version: "0.1.
|
|
1830
|
+
version: "0.1.26",
|
|
1831
1831
|
private: false,
|
|
1832
1832
|
publishConfig: {
|
|
1833
1833
|
access: "public"
|
|
@@ -12516,14 +12516,12 @@ var Order = class {
|
|
|
12516
12516
|
const collateralWithNetworkFee = BigInt(params.collateralAmount) + BigInt(networkFee);
|
|
12517
12517
|
const needsApproval = await this.utils.needsApproval(
|
|
12518
12518
|
params.executionFeeToken,
|
|
12519
|
-
collateralWithNetworkFee.toString()
|
|
12520
|
-
config.brokerAddress
|
|
12519
|
+
collateralWithNetworkFee.toString()
|
|
12521
12520
|
);
|
|
12522
12521
|
if (needsApproval) {
|
|
12523
12522
|
const approvalResult = await this.utils.approveAuthorization({
|
|
12524
12523
|
quoteAddress: params.executionFeeToken,
|
|
12525
|
-
amount: import_ethers25.ethers.MaxUint256.toString()
|
|
12526
|
-
spenderAddress: config.brokerAddress
|
|
12524
|
+
amount: import_ethers25.ethers.MaxUint256.toString()
|
|
12527
12525
|
});
|
|
12528
12526
|
if (approvalResult.code !== 0) {
|
|
12529
12527
|
throw new Error(approvalResult.message);
|
|
@@ -18186,6 +18184,8 @@ var Account = class {
|
|
|
18186
18184
|
}
|
|
18187
18185
|
async deposit({ poolId, amount, tokenAddress }) {
|
|
18188
18186
|
const config = this.configManager.getConfig();
|
|
18187
|
+
const account = await config.signer?.getAddress() ?? "";
|
|
18188
|
+
console.log("deposit", account, poolId, amount);
|
|
18189
18189
|
const contractAddress = getContractAddressByChainId(config.chainId);
|
|
18190
18190
|
const accountContract = new import_ethers27.ethers.Contract(
|
|
18191
18191
|
contractAddress.Account,
|
|
@@ -18201,15 +18201,13 @@ var Account = class {
|
|
|
18201
18201
|
if (needApproval) {
|
|
18202
18202
|
const approvalResult = await this.utils.approveAuthorization({
|
|
18203
18203
|
quoteAddress: tokenAddress,
|
|
18204
|
-
amount,
|
|
18204
|
+
amount: import_ethers27.ethers.MaxUint256.toString(),
|
|
18205
18205
|
spenderAddress: contractAddress.Account
|
|
18206
18206
|
});
|
|
18207
18207
|
if (approvalResult.code !== 0) {
|
|
18208
18208
|
throw new Error(approvalResult.message);
|
|
18209
18209
|
}
|
|
18210
18210
|
}
|
|
18211
|
-
const account = await config.signer?.getAddress() ?? "";
|
|
18212
|
-
console.log("deposit", account, poolId, amount);
|
|
18213
18211
|
const rs = await accountContract.deposit(account, poolId, amount);
|
|
18214
18212
|
const receipt = await rs?.wait(1);
|
|
18215
18213
|
return {
|
package/dist/index.mjs
CHANGED
|
@@ -1742,7 +1742,7 @@ var RotationProvider = class extends BaseProvider {
|
|
|
1742
1742
|
// package.json
|
|
1743
1743
|
var package_default = {
|
|
1744
1744
|
name: "@myx-trade/sdk",
|
|
1745
|
-
version: "0.1.
|
|
1745
|
+
version: "0.1.26",
|
|
1746
1746
|
private: false,
|
|
1747
1747
|
publishConfig: {
|
|
1748
1748
|
access: "public"
|
|
@@ -12431,14 +12431,12 @@ var Order = class {
|
|
|
12431
12431
|
const collateralWithNetworkFee = BigInt(params.collateralAmount) + BigInt(networkFee);
|
|
12432
12432
|
const needsApproval = await this.utils.needsApproval(
|
|
12433
12433
|
params.executionFeeToken,
|
|
12434
|
-
collateralWithNetworkFee.toString()
|
|
12435
|
-
config.brokerAddress
|
|
12434
|
+
collateralWithNetworkFee.toString()
|
|
12436
12435
|
);
|
|
12437
12436
|
if (needsApproval) {
|
|
12438
12437
|
const approvalResult = await this.utils.approveAuthorization({
|
|
12439
12438
|
quoteAddress: params.executionFeeToken,
|
|
12440
|
-
amount: ethers6.MaxUint256.toString()
|
|
12441
|
-
spenderAddress: config.brokerAddress
|
|
12439
|
+
amount: ethers6.MaxUint256.toString()
|
|
12442
12440
|
});
|
|
12443
12441
|
if (approvalResult.code !== 0) {
|
|
12444
12442
|
throw new Error(approvalResult.message);
|
|
@@ -18101,6 +18099,8 @@ var Account = class {
|
|
|
18101
18099
|
}
|
|
18102
18100
|
async deposit({ poolId, amount, tokenAddress }) {
|
|
18103
18101
|
const config = this.configManager.getConfig();
|
|
18102
|
+
const account = await config.signer?.getAddress() ?? "";
|
|
18103
|
+
console.log("deposit", account, poolId, amount);
|
|
18104
18104
|
const contractAddress = getContractAddressByChainId(config.chainId);
|
|
18105
18105
|
const accountContract = new ethers8.Contract(
|
|
18106
18106
|
contractAddress.Account,
|
|
@@ -18116,15 +18116,13 @@ var Account = class {
|
|
|
18116
18116
|
if (needApproval) {
|
|
18117
18117
|
const approvalResult = await this.utils.approveAuthorization({
|
|
18118
18118
|
quoteAddress: tokenAddress,
|
|
18119
|
-
amount,
|
|
18119
|
+
amount: ethers8.MaxUint256.toString(),
|
|
18120
18120
|
spenderAddress: contractAddress.Account
|
|
18121
18121
|
});
|
|
18122
18122
|
if (approvalResult.code !== 0) {
|
|
18123
18123
|
throw new Error(approvalResult.message);
|
|
18124
18124
|
}
|
|
18125
18125
|
}
|
|
18126
|
-
const account = await config.signer?.getAddress() ?? "";
|
|
18127
|
-
console.log("deposit", account, poolId, amount);
|
|
18128
18126
|
const rs = await accountContract.deposit(account, poolId, amount);
|
|
18129
18127
|
const receipt = await rs?.wait(1);
|
|
18130
18128
|
return {
|