@myx-trade/sdk 0.1.134 → 0.1.136
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.d.mts +6 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +23 -28
- package/dist/index.mjs +23 -28
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1505,8 +1505,8 @@ declare class Seamless {
|
|
|
1505
1505
|
private utils;
|
|
1506
1506
|
private account;
|
|
1507
1507
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
|
|
1508
|
-
onCheckRelayer(account: string, relayer: string): Promise<boolean>;
|
|
1509
|
-
getUSDPermitParams(deadline: number): Promise<{
|
|
1508
|
+
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<boolean>;
|
|
1509
|
+
getUSDPermitParams(deadline: number, chainId: number): Promise<{
|
|
1510
1510
|
token: string | ethers$1.Addressable;
|
|
1511
1511
|
owner: Promise<string> | undefined;
|
|
1512
1512
|
spender: string;
|
|
@@ -1536,10 +1536,11 @@ declare class Seamless {
|
|
|
1536
1536
|
authorized: boolean;
|
|
1537
1537
|
};
|
|
1538
1538
|
} | undefined>;
|
|
1539
|
-
unLockSeamlessWallet({ masterAddress, password, apiKey }: {
|
|
1539
|
+
unLockSeamlessWallet({ masterAddress, password, apiKey, chainId }: {
|
|
1540
1540
|
masterAddress: string;
|
|
1541
1541
|
password: string;
|
|
1542
1542
|
apiKey: string;
|
|
1543
|
+
chainId: number;
|
|
1543
1544
|
}): Promise<{
|
|
1544
1545
|
code: number;
|
|
1545
1546
|
data: {
|
|
@@ -1557,9 +1558,10 @@ declare class Seamless {
|
|
|
1557
1558
|
privateKey: string;
|
|
1558
1559
|
};
|
|
1559
1560
|
}>;
|
|
1560
|
-
importSeamlessPrivateKey({ privateKey, password }: {
|
|
1561
|
+
importSeamlessPrivateKey({ privateKey, password, chainId }: {
|
|
1561
1562
|
privateKey: string;
|
|
1562
1563
|
password: string;
|
|
1564
|
+
chainId: number;
|
|
1563
1565
|
}): Promise<{
|
|
1564
1566
|
code: number;
|
|
1565
1567
|
data: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1505,8 +1505,8 @@ declare class Seamless {
|
|
|
1505
1505
|
private utils;
|
|
1506
1506
|
private account;
|
|
1507
1507
|
constructor(configManager: ConfigManager, logger: Logger, utils: Utils, account: Account);
|
|
1508
|
-
onCheckRelayer(account: string, relayer: string): Promise<boolean>;
|
|
1509
|
-
getUSDPermitParams(deadline: number): Promise<{
|
|
1508
|
+
onCheckRelayer(account: string, relayer: string, chainId: number): Promise<boolean>;
|
|
1509
|
+
getUSDPermitParams(deadline: number, chainId: number): Promise<{
|
|
1510
1510
|
token: string | ethers$1.Addressable;
|
|
1511
1511
|
owner: Promise<string> | undefined;
|
|
1512
1512
|
spender: string;
|
|
@@ -1536,10 +1536,11 @@ declare class Seamless {
|
|
|
1536
1536
|
authorized: boolean;
|
|
1537
1537
|
};
|
|
1538
1538
|
} | undefined>;
|
|
1539
|
-
unLockSeamlessWallet({ masterAddress, password, apiKey }: {
|
|
1539
|
+
unLockSeamlessWallet({ masterAddress, password, apiKey, chainId }: {
|
|
1540
1540
|
masterAddress: string;
|
|
1541
1541
|
password: string;
|
|
1542
1542
|
apiKey: string;
|
|
1543
|
+
chainId: number;
|
|
1543
1544
|
}): Promise<{
|
|
1544
1545
|
code: number;
|
|
1545
1546
|
data: {
|
|
@@ -1557,9 +1558,10 @@ declare class Seamless {
|
|
|
1557
1558
|
privateKey: string;
|
|
1558
1559
|
};
|
|
1559
1560
|
}>;
|
|
1560
|
-
importSeamlessPrivateKey({ privateKey, password }: {
|
|
1561
|
+
importSeamlessPrivateKey({ privateKey, password, chainId }: {
|
|
1561
1562
|
privateKey: string;
|
|
1562
1563
|
password: string;
|
|
1564
|
+
chainId: number;
|
|
1563
1565
|
}): Promise<{
|
|
1564
1566
|
code: number;
|
|
1565
1567
|
data: {
|
package/dist/index.js
CHANGED
|
@@ -1822,7 +1822,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
|
|
|
1822
1822
|
// package.json
|
|
1823
1823
|
var package_default = {
|
|
1824
1824
|
name: "@myx-trade/sdk",
|
|
1825
|
-
version: "0.1.
|
|
1825
|
+
version: "0.1.136",
|
|
1826
1826
|
private: false,
|
|
1827
1827
|
publishConfig: {
|
|
1828
1828
|
access: "public"
|
|
@@ -12251,11 +12251,9 @@ var getLpPrice = async (chainId, poolId) => {
|
|
|
12251
12251
|
const pool = await getPoolInfo(chainId, poolId);
|
|
12252
12252
|
const contract = await getBasePoolContract(chainId);
|
|
12253
12253
|
let price = 0n;
|
|
12254
|
-
|
|
12255
|
-
|
|
12256
|
-
|
|
12257
|
-
price = (0, import_ethers13.parseUnits)(res.price, COMMON_PRICE_DECIMALS);
|
|
12258
|
-
}
|
|
12254
|
+
const res = await getPriceData(chainId, poolId);
|
|
12255
|
+
if (res?.price) {
|
|
12256
|
+
price = (0, import_ethers13.parseUnits)(res.price, COMMON_PRICE_DECIMALS);
|
|
12259
12257
|
}
|
|
12260
12258
|
const data = await contract.getPoolTokenPrice(poolId, price);
|
|
12261
12259
|
return data;
|
|
@@ -12618,11 +12616,9 @@ var getLpPrice2 = async (chainId, poolId) => {
|
|
|
12618
12616
|
const pool = await getPoolInfo(chainId, poolId);
|
|
12619
12617
|
const contract = await getQuotePoolContract(chainId);
|
|
12620
12618
|
let price = 0n;
|
|
12621
|
-
|
|
12622
|
-
|
|
12623
|
-
|
|
12624
|
-
price = (0, import_ethers19.parseUnits)(res.price, COMMON_PRICE_DECIMALS);
|
|
12625
|
-
}
|
|
12619
|
+
const res = await getPriceData(chainId, poolId);
|
|
12620
|
+
if (res?.price) {
|
|
12621
|
+
price = (0, import_ethers19.parseUnits)(res.price, COMMON_PRICE_DECIMALS);
|
|
12626
12622
|
}
|
|
12627
12623
|
const data = await contract.getPoolTokenPrice(poolId, price);
|
|
12628
12624
|
return data;
|
|
@@ -14718,13 +14714,13 @@ var Order = class {
|
|
|
14718
14714
|
data: rs
|
|
14719
14715
|
};
|
|
14720
14716
|
}
|
|
14717
|
+
if (!config.signer) {
|
|
14718
|
+
throw new MyxSDKError("INVALID_SIGNER" /* InvalidSigner */, "Invalid signer");
|
|
14719
|
+
}
|
|
14721
14720
|
const brokerContract = await getBrokerSingerContract(
|
|
14722
14721
|
params.chainId,
|
|
14723
14722
|
this.configManager.getConfig().brokerAddress
|
|
14724
14723
|
);
|
|
14725
|
-
if (!config.signer) {
|
|
14726
|
-
throw new MyxSDKError("INVALID_SIGNER" /* InvalidSigner */, "Invalid signer");
|
|
14727
|
-
}
|
|
14728
14724
|
if (needsApproval) {
|
|
14729
14725
|
const approvalResult = await this.utils.approveAuthorization({
|
|
14730
14726
|
chainId: params.chainId,
|
|
@@ -14735,6 +14731,8 @@ var Order = class {
|
|
|
14735
14731
|
throw new Error(approvalResult.message);
|
|
14736
14732
|
}
|
|
14737
14733
|
}
|
|
14734
|
+
console.log("depositData-->", depositData);
|
|
14735
|
+
console.log("data-->", data);
|
|
14738
14736
|
let transaction;
|
|
14739
14737
|
if (!params.positionId) {
|
|
14740
14738
|
const positionId = 1;
|
|
@@ -21390,18 +21388,17 @@ var Seamless = class {
|
|
|
21390
21388
|
this.utils = utils;
|
|
21391
21389
|
this.account = account;
|
|
21392
21390
|
}
|
|
21393
|
-
async onCheckRelayer(account, relayer) {
|
|
21391
|
+
async onCheckRelayer(account, relayer, chainId) {
|
|
21394
21392
|
const config = this.configManager.getConfig();
|
|
21395
|
-
const forwarderContract = await getForwarderContract(
|
|
21393
|
+
const forwarderContract = await getForwarderContract(chainId);
|
|
21396
21394
|
const checkRelayerResult = await forwarderContract.isUserRelayerEnabled(account, relayer);
|
|
21397
21395
|
return checkRelayerResult;
|
|
21398
21396
|
}
|
|
21399
|
-
async getUSDPermitParams(deadline) {
|
|
21397
|
+
async getUSDPermitParams(deadline, chainId) {
|
|
21400
21398
|
const config = this.configManager.getConfig();
|
|
21401
|
-
const chainId = config.chainId;
|
|
21402
21399
|
const masterAddress = config.signer?.getAddress();
|
|
21403
21400
|
const brokerAddress = config.brokerAddress;
|
|
21404
|
-
const contractAddress = getContractAddressByChainId(
|
|
21401
|
+
const contractAddress = getContractAddressByChainId(chainId);
|
|
21405
21402
|
const erc20Contract = new import_ethers27.ethers.Contract(
|
|
21406
21403
|
contractAddress.ERC20,
|
|
21407
21404
|
ERC20Token_default,
|
|
@@ -21467,7 +21464,6 @@ var Seamless = class {
|
|
|
21467
21464
|
return txRs;
|
|
21468
21465
|
}
|
|
21469
21466
|
async authorizeSeamlessAccount({ approve: approve2, seamlessAddress, chainId }) {
|
|
21470
|
-
console.log("authorizeSeamlessAccount-->", approve2, seamlessAddress, chainId);
|
|
21471
21467
|
const config = this.configManager.getConfig();
|
|
21472
21468
|
const accessToken = await this.configManager.getAccessToken();
|
|
21473
21469
|
if (!accessToken) {
|
|
@@ -21521,7 +21517,6 @@ var Seamless = class {
|
|
|
21521
21517
|
const getRs = await fetchForwarderGetApi({
|
|
21522
21518
|
requestId: txRs.data?.requestId
|
|
21523
21519
|
});
|
|
21524
|
-
this.logger.info("authorizeSeamlessAccount result-->", getRs);
|
|
21525
21520
|
if (getRs.data?.status === 9 /* EXECUTED */) {
|
|
21526
21521
|
if (getRs.data?.txHash) {
|
|
21527
21522
|
txRs.data.txHash = getRs.data.txHash;
|
|
@@ -21552,7 +21547,7 @@ var Seamless = class {
|
|
|
21552
21547
|
}
|
|
21553
21548
|
}
|
|
21554
21549
|
}
|
|
21555
|
-
async unLockSeamlessWallet({ masterAddress, password, apiKey }) {
|
|
21550
|
+
async unLockSeamlessWallet({ masterAddress, password, apiKey, chainId }) {
|
|
21556
21551
|
const key = import_crypto_js.default.enc.Utf8.parse(charFill(password));
|
|
21557
21552
|
const iv = getIvMapString();
|
|
21558
21553
|
const decrypted = import_crypto_js.default.AES.decrypt(apiKey, key, {
|
|
@@ -21562,7 +21557,7 @@ var Seamless = class {
|
|
|
21562
21557
|
});
|
|
21563
21558
|
const privateKey = decrypted.toString(import_crypto_js.default.enc.Utf8);
|
|
21564
21559
|
const wallet = new import_ethers27.ethers.Wallet(privateKey);
|
|
21565
|
-
const isAuthorized = await this.onCheckRelayer(masterAddress, wallet.address);
|
|
21560
|
+
const isAuthorized = await this.onCheckRelayer(masterAddress, wallet.address, chainId);
|
|
21566
21561
|
this.configManager.updateSeamlessWallet({
|
|
21567
21562
|
masterAddress,
|
|
21568
21563
|
wallet,
|
|
@@ -21597,7 +21592,7 @@ var Seamless = class {
|
|
|
21597
21592
|
}
|
|
21598
21593
|
};
|
|
21599
21594
|
}
|
|
21600
|
-
async importSeamlessPrivateKey({ privateKey, password }) {
|
|
21595
|
+
async importSeamlessPrivateKey({ privateKey, password, chainId }) {
|
|
21601
21596
|
const config = this.configManager.getConfig();
|
|
21602
21597
|
if (!import_ethers27.ethers.isHexString(privateKey, 32)) {
|
|
21603
21598
|
throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "Invalid private key");
|
|
@@ -21608,7 +21603,7 @@ var Seamless = class {
|
|
|
21608
21603
|
if (masterAddress === import_ethers27.ZeroAddress) {
|
|
21609
21604
|
throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "The private key is not a senseless account");
|
|
21610
21605
|
}
|
|
21611
|
-
const isAuthorized = await this.onCheckRelayer(masterAddress, wallet.address);
|
|
21606
|
+
const isAuthorized = await this.onCheckRelayer(masterAddress, wallet.address, chainId);
|
|
21612
21607
|
const key = import_crypto_js.default.enc.Utf8.parse(charFill(password));
|
|
21613
21608
|
const iv = getIvMapString();
|
|
21614
21609
|
const encrypted = import_crypto_js.default.AES.encrypt(privateKey, key, {
|
|
@@ -21660,14 +21655,14 @@ var Seamless = class {
|
|
|
21660
21655
|
padding: import_crypto_js.default.pad.Pkcs7
|
|
21661
21656
|
});
|
|
21662
21657
|
const apiKey = encrypted.toString();
|
|
21663
|
-
let isAuthorized = await this.onCheckRelayer(account, wallet.address);
|
|
21658
|
+
let isAuthorized = await this.onCheckRelayer(account, wallet.address, chainId);
|
|
21664
21659
|
this.configManager.updateSeamlessWallet({
|
|
21665
21660
|
masterAddress: account,
|
|
21666
21661
|
wallet,
|
|
21667
21662
|
authorized: isAuthorized
|
|
21668
21663
|
});
|
|
21669
|
-
const forwarderContract = await getForwarderContract(
|
|
21670
|
-
const erc20Address = getContractAddressByChainId(
|
|
21664
|
+
const forwarderContract = await getForwarderContract(chainId);
|
|
21665
|
+
const erc20Address = getContractAddressByChainId(chainId).ERC20;
|
|
21671
21666
|
await this.utils.approveAuthorization({
|
|
21672
21667
|
chainId,
|
|
21673
21668
|
quoteAddress: erc20Address,
|
package/dist/index.mjs
CHANGED
|
@@ -1732,7 +1732,7 @@ var RotationProvider = class extends BaseProvider {
|
|
|
1732
1732
|
// package.json
|
|
1733
1733
|
var package_default = {
|
|
1734
1734
|
name: "@myx-trade/sdk",
|
|
1735
|
-
version: "0.1.
|
|
1735
|
+
version: "0.1.136",
|
|
1736
1736
|
private: false,
|
|
1737
1737
|
publishConfig: {
|
|
1738
1738
|
access: "public"
|
|
@@ -12161,11 +12161,9 @@ var getLpPrice = async (chainId, poolId) => {
|
|
|
12161
12161
|
const pool = await getPoolInfo(chainId, poolId);
|
|
12162
12162
|
const contract = await getBasePoolContract(chainId);
|
|
12163
12163
|
let price = 0n;
|
|
12164
|
-
|
|
12165
|
-
|
|
12166
|
-
|
|
12167
|
-
price = parseUnits10(res.price, COMMON_PRICE_DECIMALS);
|
|
12168
|
-
}
|
|
12164
|
+
const res = await getPriceData(chainId, poolId);
|
|
12165
|
+
if (res?.price) {
|
|
12166
|
+
price = parseUnits10(res.price, COMMON_PRICE_DECIMALS);
|
|
12169
12167
|
}
|
|
12170
12168
|
const data = await contract.getPoolTokenPrice(poolId, price);
|
|
12171
12169
|
return data;
|
|
@@ -12528,11 +12526,9 @@ var getLpPrice2 = async (chainId, poolId) => {
|
|
|
12528
12526
|
const pool = await getPoolInfo(chainId, poolId);
|
|
12529
12527
|
const contract = await getQuotePoolContract(chainId);
|
|
12530
12528
|
let price = 0n;
|
|
12531
|
-
|
|
12532
|
-
|
|
12533
|
-
|
|
12534
|
-
price = parseUnits16(res.price, COMMON_PRICE_DECIMALS);
|
|
12535
|
-
}
|
|
12529
|
+
const res = await getPriceData(chainId, poolId);
|
|
12530
|
+
if (res?.price) {
|
|
12531
|
+
price = parseUnits16(res.price, COMMON_PRICE_DECIMALS);
|
|
12536
12532
|
}
|
|
12537
12533
|
const data = await contract.getPoolTokenPrice(poolId, price);
|
|
12538
12534
|
return data;
|
|
@@ -14628,13 +14624,13 @@ var Order = class {
|
|
|
14628
14624
|
data: rs
|
|
14629
14625
|
};
|
|
14630
14626
|
}
|
|
14627
|
+
if (!config.signer) {
|
|
14628
|
+
throw new MyxSDKError("INVALID_SIGNER" /* InvalidSigner */, "Invalid signer");
|
|
14629
|
+
}
|
|
14631
14630
|
const brokerContract = await getBrokerSingerContract(
|
|
14632
14631
|
params.chainId,
|
|
14633
14632
|
this.configManager.getConfig().brokerAddress
|
|
14634
14633
|
);
|
|
14635
|
-
if (!config.signer) {
|
|
14636
|
-
throw new MyxSDKError("INVALID_SIGNER" /* InvalidSigner */, "Invalid signer");
|
|
14637
|
-
}
|
|
14638
14634
|
if (needsApproval) {
|
|
14639
14635
|
const approvalResult = await this.utils.approveAuthorization({
|
|
14640
14636
|
chainId: params.chainId,
|
|
@@ -14645,6 +14641,8 @@ var Order = class {
|
|
|
14645
14641
|
throw new Error(approvalResult.message);
|
|
14646
14642
|
}
|
|
14647
14643
|
}
|
|
14644
|
+
console.log("depositData-->", depositData);
|
|
14645
|
+
console.log("data-->", data);
|
|
14648
14646
|
let transaction;
|
|
14649
14647
|
if (!params.positionId) {
|
|
14650
14648
|
const positionId = 1;
|
|
@@ -21300,18 +21298,17 @@ var Seamless = class {
|
|
|
21300
21298
|
this.utils = utils;
|
|
21301
21299
|
this.account = account;
|
|
21302
21300
|
}
|
|
21303
|
-
async onCheckRelayer(account, relayer) {
|
|
21301
|
+
async onCheckRelayer(account, relayer, chainId) {
|
|
21304
21302
|
const config = this.configManager.getConfig();
|
|
21305
|
-
const forwarderContract = await getForwarderContract(
|
|
21303
|
+
const forwarderContract = await getForwarderContract(chainId);
|
|
21306
21304
|
const checkRelayerResult = await forwarderContract.isUserRelayerEnabled(account, relayer);
|
|
21307
21305
|
return checkRelayerResult;
|
|
21308
21306
|
}
|
|
21309
|
-
async getUSDPermitParams(deadline) {
|
|
21307
|
+
async getUSDPermitParams(deadline, chainId) {
|
|
21310
21308
|
const config = this.configManager.getConfig();
|
|
21311
|
-
const chainId = config.chainId;
|
|
21312
21309
|
const masterAddress = config.signer?.getAddress();
|
|
21313
21310
|
const brokerAddress = config.brokerAddress;
|
|
21314
|
-
const contractAddress = getContractAddressByChainId(
|
|
21311
|
+
const contractAddress = getContractAddressByChainId(chainId);
|
|
21315
21312
|
const erc20Contract = new ethers9.Contract(
|
|
21316
21313
|
contractAddress.ERC20,
|
|
21317
21314
|
ERC20Token_default,
|
|
@@ -21377,7 +21374,6 @@ var Seamless = class {
|
|
|
21377
21374
|
return txRs;
|
|
21378
21375
|
}
|
|
21379
21376
|
async authorizeSeamlessAccount({ approve: approve2, seamlessAddress, chainId }) {
|
|
21380
|
-
console.log("authorizeSeamlessAccount-->", approve2, seamlessAddress, chainId);
|
|
21381
21377
|
const config = this.configManager.getConfig();
|
|
21382
21378
|
const accessToken = await this.configManager.getAccessToken();
|
|
21383
21379
|
if (!accessToken) {
|
|
@@ -21431,7 +21427,6 @@ var Seamless = class {
|
|
|
21431
21427
|
const getRs = await fetchForwarderGetApi({
|
|
21432
21428
|
requestId: txRs.data?.requestId
|
|
21433
21429
|
});
|
|
21434
|
-
this.logger.info("authorizeSeamlessAccount result-->", getRs);
|
|
21435
21430
|
if (getRs.data?.status === 9 /* EXECUTED */) {
|
|
21436
21431
|
if (getRs.data?.txHash) {
|
|
21437
21432
|
txRs.data.txHash = getRs.data.txHash;
|
|
@@ -21462,7 +21457,7 @@ var Seamless = class {
|
|
|
21462
21457
|
}
|
|
21463
21458
|
}
|
|
21464
21459
|
}
|
|
21465
|
-
async unLockSeamlessWallet({ masterAddress, password, apiKey }) {
|
|
21460
|
+
async unLockSeamlessWallet({ masterAddress, password, apiKey, chainId }) {
|
|
21466
21461
|
const key = CryptoJS.enc.Utf8.parse(charFill(password));
|
|
21467
21462
|
const iv = getIvMapString();
|
|
21468
21463
|
const decrypted = CryptoJS.AES.decrypt(apiKey, key, {
|
|
@@ -21472,7 +21467,7 @@ var Seamless = class {
|
|
|
21472
21467
|
});
|
|
21473
21468
|
const privateKey = decrypted.toString(CryptoJS.enc.Utf8);
|
|
21474
21469
|
const wallet = new ethers9.Wallet(privateKey);
|
|
21475
|
-
const isAuthorized = await this.onCheckRelayer(masterAddress, wallet.address);
|
|
21470
|
+
const isAuthorized = await this.onCheckRelayer(masterAddress, wallet.address, chainId);
|
|
21476
21471
|
this.configManager.updateSeamlessWallet({
|
|
21477
21472
|
masterAddress,
|
|
21478
21473
|
wallet,
|
|
@@ -21507,7 +21502,7 @@ var Seamless = class {
|
|
|
21507
21502
|
}
|
|
21508
21503
|
};
|
|
21509
21504
|
}
|
|
21510
|
-
async importSeamlessPrivateKey({ privateKey, password }) {
|
|
21505
|
+
async importSeamlessPrivateKey({ privateKey, password, chainId }) {
|
|
21511
21506
|
const config = this.configManager.getConfig();
|
|
21512
21507
|
if (!ethers9.isHexString(privateKey, 32)) {
|
|
21513
21508
|
throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "Invalid private key");
|
|
@@ -21518,7 +21513,7 @@ var Seamless = class {
|
|
|
21518
21513
|
if (masterAddress === ZeroAddress2) {
|
|
21519
21514
|
throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "The private key is not a senseless account");
|
|
21520
21515
|
}
|
|
21521
|
-
const isAuthorized = await this.onCheckRelayer(masterAddress, wallet.address);
|
|
21516
|
+
const isAuthorized = await this.onCheckRelayer(masterAddress, wallet.address, chainId);
|
|
21522
21517
|
const key = CryptoJS.enc.Utf8.parse(charFill(password));
|
|
21523
21518
|
const iv = getIvMapString();
|
|
21524
21519
|
const encrypted = CryptoJS.AES.encrypt(privateKey, key, {
|
|
@@ -21570,14 +21565,14 @@ var Seamless = class {
|
|
|
21570
21565
|
padding: CryptoJS.pad.Pkcs7
|
|
21571
21566
|
});
|
|
21572
21567
|
const apiKey = encrypted.toString();
|
|
21573
|
-
let isAuthorized = await this.onCheckRelayer(account, wallet.address);
|
|
21568
|
+
let isAuthorized = await this.onCheckRelayer(account, wallet.address, chainId);
|
|
21574
21569
|
this.configManager.updateSeamlessWallet({
|
|
21575
21570
|
masterAddress: account,
|
|
21576
21571
|
wallet,
|
|
21577
21572
|
authorized: isAuthorized
|
|
21578
21573
|
});
|
|
21579
|
-
const forwarderContract = await getForwarderContract(
|
|
21580
|
-
const erc20Address = getContractAddressByChainId(
|
|
21574
|
+
const forwarderContract = await getForwarderContract(chainId);
|
|
21575
|
+
const erc20Address = getContractAddressByChainId(chainId).ERC20;
|
|
21581
21576
|
await this.utils.approveAuthorization({
|
|
21582
21577
|
chainId,
|
|
21583
21578
|
quoteAddress: erc20Address,
|