@myx-trade/sdk 0.1.7 → 0.1.15

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 CHANGED
@@ -1481,12 +1481,26 @@ declare class Account {
1481
1481
  private logger;
1482
1482
  private utils;
1483
1483
  constructor(configManager: ConfigManager, logger: Logger, utils: Utils);
1484
+ getWalletQuoteTokenBalance(quoteAddress: string): Promise<{
1485
+ code: number;
1486
+ data: any;
1487
+ }>;
1484
1488
  /**
1485
1489
  * get tradable amount
1486
1490
  */
1487
1491
  getTradableAmount({ poolId }: {
1488
1492
  poolId: string;
1489
- }): Promise<any>;
1493
+ }): Promise<{
1494
+ code: number;
1495
+ data: {
1496
+ profitIsReleased: any;
1497
+ freeAmount: any;
1498
+ tradeableProfit: any;
1499
+ };
1500
+ } | {
1501
+ code: number;
1502
+ data?: undefined;
1503
+ }>;
1490
1504
  getTradeFlow(params: GetHistoryOrdersParams): Promise<{
1491
1505
  code: number;
1492
1506
  data: TradeFlowItem[];
package/dist/index.d.ts CHANGED
@@ -1481,12 +1481,26 @@ declare class Account {
1481
1481
  private logger;
1482
1482
  private utils;
1483
1483
  constructor(configManager: ConfigManager, logger: Logger, utils: Utils);
1484
+ getWalletQuoteTokenBalance(quoteAddress: string): Promise<{
1485
+ code: number;
1486
+ data: any;
1487
+ }>;
1484
1488
  /**
1485
1489
  * get tradable amount
1486
1490
  */
1487
1491
  getTradableAmount({ poolId }: {
1488
1492
  poolId: string;
1489
- }): Promise<any>;
1493
+ }): Promise<{
1494
+ code: number;
1495
+ data: {
1496
+ profitIsReleased: any;
1497
+ freeAmount: any;
1498
+ tradeableProfit: any;
1499
+ };
1500
+ } | {
1501
+ code: number;
1502
+ data?: undefined;
1503
+ }>;
1490
1504
  getTradeFlow(params: GetHistoryOrdersParams): Promise<{
1491
1505
  code: number;
1492
1506
  data: TradeFlowItem[];
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.7",
1830
+ version: "0.1.15",
1831
1831
  private: false,
1832
1832
  publishConfig: {
1833
1833
  access: "public"
@@ -17564,6 +17564,531 @@ var Account_default = [
17564
17564
  }
17565
17565
  ];
17566
17566
 
17567
+ // src/abi/ERC20Token.json
17568
+ var ERC20Token_default = [
17569
+ {
17570
+ type: "constructor",
17571
+ payable: false,
17572
+ inputs: [
17573
+ {
17574
+ type: "string",
17575
+ name: "name"
17576
+ },
17577
+ {
17578
+ type: "string",
17579
+ name: "symbol"
17580
+ },
17581
+ {
17582
+ type: "uint8",
17583
+ name: "decimals_"
17584
+ }
17585
+ ]
17586
+ },
17587
+ {
17588
+ type: "error",
17589
+ name: "ECDSAInvalidSignature",
17590
+ inputs: []
17591
+ },
17592
+ {
17593
+ type: "error",
17594
+ name: "ECDSAInvalidSignatureLength",
17595
+ inputs: [
17596
+ {
17597
+ type: "uint256",
17598
+ name: "length"
17599
+ }
17600
+ ]
17601
+ },
17602
+ {
17603
+ type: "error",
17604
+ name: "ECDSAInvalidSignatureS",
17605
+ inputs: [
17606
+ {
17607
+ type: "bytes32",
17608
+ name: "s"
17609
+ }
17610
+ ]
17611
+ },
17612
+ {
17613
+ type: "error",
17614
+ name: "ERC20InsufficientAllowance",
17615
+ inputs: [
17616
+ {
17617
+ type: "address",
17618
+ name: "spender"
17619
+ },
17620
+ {
17621
+ type: "uint256",
17622
+ name: "allowance"
17623
+ },
17624
+ {
17625
+ type: "uint256",
17626
+ name: "needed"
17627
+ }
17628
+ ]
17629
+ },
17630
+ {
17631
+ type: "error",
17632
+ name: "ERC20InsufficientBalance",
17633
+ inputs: [
17634
+ {
17635
+ type: "address",
17636
+ name: "sender"
17637
+ },
17638
+ {
17639
+ type: "uint256",
17640
+ name: "balance"
17641
+ },
17642
+ {
17643
+ type: "uint256",
17644
+ name: "needed"
17645
+ }
17646
+ ]
17647
+ },
17648
+ {
17649
+ type: "error",
17650
+ name: "ERC20InvalidApprover",
17651
+ inputs: [
17652
+ {
17653
+ type: "address",
17654
+ name: "approver"
17655
+ }
17656
+ ]
17657
+ },
17658
+ {
17659
+ type: "error",
17660
+ name: "ERC20InvalidReceiver",
17661
+ inputs: [
17662
+ {
17663
+ type: "address",
17664
+ name: "receiver"
17665
+ }
17666
+ ]
17667
+ },
17668
+ {
17669
+ type: "error",
17670
+ name: "ERC20InvalidSender",
17671
+ inputs: [
17672
+ {
17673
+ type: "address",
17674
+ name: "sender"
17675
+ }
17676
+ ]
17677
+ },
17678
+ {
17679
+ type: "error",
17680
+ name: "ERC20InvalidSpender",
17681
+ inputs: [
17682
+ {
17683
+ type: "address",
17684
+ name: "spender"
17685
+ }
17686
+ ]
17687
+ },
17688
+ {
17689
+ type: "error",
17690
+ name: "ERC2612ExpiredSignature",
17691
+ inputs: [
17692
+ {
17693
+ type: "uint256",
17694
+ name: "deadline"
17695
+ }
17696
+ ]
17697
+ },
17698
+ {
17699
+ type: "error",
17700
+ name: "ERC2612InvalidSigner",
17701
+ inputs: [
17702
+ {
17703
+ type: "address",
17704
+ name: "signer"
17705
+ },
17706
+ {
17707
+ type: "address",
17708
+ name: "owner"
17709
+ }
17710
+ ]
17711
+ },
17712
+ {
17713
+ type: "error",
17714
+ name: "InvalidAccountNonce",
17715
+ inputs: [
17716
+ {
17717
+ type: "address",
17718
+ name: "account"
17719
+ },
17720
+ {
17721
+ type: "uint256",
17722
+ name: "currentNonce"
17723
+ }
17724
+ ]
17725
+ },
17726
+ {
17727
+ type: "error",
17728
+ name: "InvalidShortString",
17729
+ inputs: []
17730
+ },
17731
+ {
17732
+ type: "error",
17733
+ name: "StringTooLong",
17734
+ inputs: [
17735
+ {
17736
+ type: "string",
17737
+ name: "str"
17738
+ }
17739
+ ]
17740
+ },
17741
+ {
17742
+ type: "event",
17743
+ anonymous: false,
17744
+ name: "Approval",
17745
+ inputs: [
17746
+ {
17747
+ type: "address",
17748
+ name: "owner",
17749
+ indexed: true
17750
+ },
17751
+ {
17752
+ type: "address",
17753
+ name: "spender",
17754
+ indexed: true
17755
+ },
17756
+ {
17757
+ type: "uint256",
17758
+ name: "value",
17759
+ indexed: false
17760
+ }
17761
+ ]
17762
+ },
17763
+ {
17764
+ type: "event",
17765
+ anonymous: false,
17766
+ name: "EIP712DomainChanged",
17767
+ inputs: []
17768
+ },
17769
+ {
17770
+ type: "event",
17771
+ anonymous: false,
17772
+ name: "Transfer",
17773
+ inputs: [
17774
+ {
17775
+ type: "address",
17776
+ name: "from",
17777
+ indexed: true
17778
+ },
17779
+ {
17780
+ type: "address",
17781
+ name: "to",
17782
+ indexed: true
17783
+ },
17784
+ {
17785
+ type: "uint256",
17786
+ name: "value",
17787
+ indexed: false
17788
+ }
17789
+ ]
17790
+ },
17791
+ {
17792
+ type: "function",
17793
+ name: "DOMAIN_SEPARATOR",
17794
+ constant: true,
17795
+ stateMutability: "view",
17796
+ payable: false,
17797
+ inputs: [],
17798
+ outputs: [
17799
+ {
17800
+ type: "bytes32"
17801
+ }
17802
+ ]
17803
+ },
17804
+ {
17805
+ type: "function",
17806
+ name: "allowance",
17807
+ constant: true,
17808
+ stateMutability: "view",
17809
+ payable: false,
17810
+ inputs: [
17811
+ {
17812
+ type: "address",
17813
+ name: "owner"
17814
+ },
17815
+ {
17816
+ type: "address",
17817
+ name: "spender"
17818
+ }
17819
+ ],
17820
+ outputs: [
17821
+ {
17822
+ type: "uint256"
17823
+ }
17824
+ ]
17825
+ },
17826
+ {
17827
+ type: "function",
17828
+ name: "approve",
17829
+ constant: false,
17830
+ payable: false,
17831
+ inputs: [
17832
+ {
17833
+ type: "address",
17834
+ name: "spender"
17835
+ },
17836
+ {
17837
+ type: "uint256",
17838
+ name: "value"
17839
+ }
17840
+ ],
17841
+ outputs: [
17842
+ {
17843
+ type: "bool"
17844
+ }
17845
+ ]
17846
+ },
17847
+ {
17848
+ type: "function",
17849
+ name: "balanceOf",
17850
+ constant: true,
17851
+ stateMutability: "view",
17852
+ payable: false,
17853
+ inputs: [
17854
+ {
17855
+ type: "address",
17856
+ name: "account"
17857
+ }
17858
+ ],
17859
+ outputs: [
17860
+ {
17861
+ type: "uint256"
17862
+ }
17863
+ ]
17864
+ },
17865
+ {
17866
+ type: "function",
17867
+ name: "decimals",
17868
+ constant: true,
17869
+ stateMutability: "view",
17870
+ payable: false,
17871
+ inputs: [],
17872
+ outputs: [
17873
+ {
17874
+ type: "uint8"
17875
+ }
17876
+ ]
17877
+ },
17878
+ {
17879
+ type: "function",
17880
+ name: "eip712Domain",
17881
+ constant: true,
17882
+ stateMutability: "view",
17883
+ payable: false,
17884
+ inputs: [],
17885
+ outputs: [
17886
+ {
17887
+ type: "bytes1",
17888
+ name: "fields"
17889
+ },
17890
+ {
17891
+ type: "string",
17892
+ name: "name"
17893
+ },
17894
+ {
17895
+ type: "string",
17896
+ name: "version"
17897
+ },
17898
+ {
17899
+ type: "uint256",
17900
+ name: "chainId"
17901
+ },
17902
+ {
17903
+ type: "address",
17904
+ name: "verifyingContract"
17905
+ },
17906
+ {
17907
+ type: "bytes32",
17908
+ name: "salt"
17909
+ },
17910
+ {
17911
+ type: "uint256[]",
17912
+ name: "extensions"
17913
+ }
17914
+ ]
17915
+ },
17916
+ {
17917
+ type: "function",
17918
+ name: "mint",
17919
+ constant: false,
17920
+ payable: false,
17921
+ inputs: [
17922
+ {
17923
+ type: "address",
17924
+ name: "to"
17925
+ },
17926
+ {
17927
+ type: "uint256",
17928
+ name: "amount"
17929
+ }
17930
+ ],
17931
+ outputs: []
17932
+ },
17933
+ {
17934
+ type: "function",
17935
+ name: "mintFor",
17936
+ constant: false,
17937
+ payable: false,
17938
+ inputs: [
17939
+ {
17940
+ type: "address",
17941
+ name: "to"
17942
+ },
17943
+ {
17944
+ type: "uint256",
17945
+ name: "amount"
17946
+ }
17947
+ ],
17948
+ outputs: []
17949
+ },
17950
+ {
17951
+ type: "function",
17952
+ name: "name",
17953
+ constant: true,
17954
+ stateMutability: "view",
17955
+ payable: false,
17956
+ inputs: [],
17957
+ outputs: [
17958
+ {
17959
+ type: "string"
17960
+ }
17961
+ ]
17962
+ },
17963
+ {
17964
+ type: "function",
17965
+ name: "nonces",
17966
+ constant: true,
17967
+ stateMutability: "view",
17968
+ payable: false,
17969
+ inputs: [
17970
+ {
17971
+ type: "address",
17972
+ name: "owner"
17973
+ }
17974
+ ],
17975
+ outputs: [
17976
+ {
17977
+ type: "uint256"
17978
+ }
17979
+ ]
17980
+ },
17981
+ {
17982
+ type: "function",
17983
+ name: "permit",
17984
+ constant: false,
17985
+ payable: false,
17986
+ inputs: [
17987
+ {
17988
+ type: "address",
17989
+ name: "owner"
17990
+ },
17991
+ {
17992
+ type: "address",
17993
+ name: "spender"
17994
+ },
17995
+ {
17996
+ type: "uint256",
17997
+ name: "value"
17998
+ },
17999
+ {
18000
+ type: "uint256",
18001
+ name: "deadline"
18002
+ },
18003
+ {
18004
+ type: "uint8",
18005
+ name: "v"
18006
+ },
18007
+ {
18008
+ type: "bytes32",
18009
+ name: "r"
18010
+ },
18011
+ {
18012
+ type: "bytes32",
18013
+ name: "s"
18014
+ }
18015
+ ],
18016
+ outputs: []
18017
+ },
18018
+ {
18019
+ type: "function",
18020
+ name: "symbol",
18021
+ constant: true,
18022
+ stateMutability: "view",
18023
+ payable: false,
18024
+ inputs: [],
18025
+ outputs: [
18026
+ {
18027
+ type: "string"
18028
+ }
18029
+ ]
18030
+ },
18031
+ {
18032
+ type: "function",
18033
+ name: "totalSupply",
18034
+ constant: true,
18035
+ stateMutability: "view",
18036
+ payable: false,
18037
+ inputs: [],
18038
+ outputs: [
18039
+ {
18040
+ type: "uint256"
18041
+ }
18042
+ ]
18043
+ },
18044
+ {
18045
+ type: "function",
18046
+ name: "transfer",
18047
+ constant: false,
18048
+ payable: false,
18049
+ inputs: [
18050
+ {
18051
+ type: "address",
18052
+ name: "to"
18053
+ },
18054
+ {
18055
+ type: "uint256",
18056
+ name: "value"
18057
+ }
18058
+ ],
18059
+ outputs: [
18060
+ {
18061
+ type: "bool"
18062
+ }
18063
+ ]
18064
+ },
18065
+ {
18066
+ type: "function",
18067
+ name: "transferFrom",
18068
+ constant: false,
18069
+ payable: false,
18070
+ inputs: [
18071
+ {
18072
+ type: "address",
18073
+ name: "from"
18074
+ },
18075
+ {
18076
+ type: "address",
18077
+ name: "to"
18078
+ },
18079
+ {
18080
+ type: "uint256",
18081
+ name: "value"
18082
+ }
18083
+ ],
18084
+ outputs: [
18085
+ {
18086
+ type: "bool"
18087
+ }
18088
+ ]
18089
+ }
18090
+ ];
18091
+
17567
18092
  // src/manager/account/index.ts
17568
18093
  var Account = class {
17569
18094
  constructor(configManager, logger, utils) {
@@ -17571,6 +18096,19 @@ var Account = class {
17571
18096
  this.logger = logger;
17572
18097
  this.utils = utils;
17573
18098
  }
18099
+ async getWalletQuoteTokenBalance(quoteAddress) {
18100
+ const config = this.configManager.getConfig();
18101
+ const erc20Contract = new import_ethers26.ethers.Contract(
18102
+ quoteAddress,
18103
+ ERC20Token_default,
18104
+ config.signer
18105
+ );
18106
+ const balance = await erc20Contract.balanceOf(config.signer.getAddress());
18107
+ return {
18108
+ code: 0,
18109
+ data: balance
18110
+ };
18111
+ }
17574
18112
  /**
17575
18113
  * get tradable amount
17576
18114
  */
@@ -17582,8 +18120,22 @@ var Account = class {
17582
18120
  Account_default,
17583
18121
  config.signer
17584
18122
  );
17585
- const assets = await accountContract.getTradableAmount(config.signer.getAddress(), poolId);
17586
- return assets;
18123
+ try {
18124
+ const assets = await accountContract.getTradableAmount(config.signer.getAddress(), poolId);
18125
+ const data = {
18126
+ profitIsReleased: assets[0],
18127
+ freeAmount: assets[1],
18128
+ tradeableProfit: assets[2]
18129
+ };
18130
+ return {
18131
+ code: 0,
18132
+ data
18133
+ };
18134
+ } catch (error) {
18135
+ return {
18136
+ code: -1
18137
+ };
18138
+ }
17587
18139
  }
17588
18140
  async getTradeFlow(params) {
17589
18141
  const accessToken = await this.configManager.getAccessToken();
package/dist/index.mjs CHANGED
@@ -1741,7 +1741,7 @@ var RotationProvider = class extends BaseProvider {
1741
1741
  // package.json
1742
1742
  var package_default = {
1743
1743
  name: "@myx-trade/sdk",
1744
- version: "0.1.7",
1744
+ version: "0.1.15",
1745
1745
  private: false,
1746
1746
  publishConfig: {
1747
1747
  access: "public"
@@ -17478,6 +17478,531 @@ var Account_default = [
17478
17478
  }
17479
17479
  ];
17480
17480
 
17481
+ // src/abi/ERC20Token.json
17482
+ var ERC20Token_default = [
17483
+ {
17484
+ type: "constructor",
17485
+ payable: false,
17486
+ inputs: [
17487
+ {
17488
+ type: "string",
17489
+ name: "name"
17490
+ },
17491
+ {
17492
+ type: "string",
17493
+ name: "symbol"
17494
+ },
17495
+ {
17496
+ type: "uint8",
17497
+ name: "decimals_"
17498
+ }
17499
+ ]
17500
+ },
17501
+ {
17502
+ type: "error",
17503
+ name: "ECDSAInvalidSignature",
17504
+ inputs: []
17505
+ },
17506
+ {
17507
+ type: "error",
17508
+ name: "ECDSAInvalidSignatureLength",
17509
+ inputs: [
17510
+ {
17511
+ type: "uint256",
17512
+ name: "length"
17513
+ }
17514
+ ]
17515
+ },
17516
+ {
17517
+ type: "error",
17518
+ name: "ECDSAInvalidSignatureS",
17519
+ inputs: [
17520
+ {
17521
+ type: "bytes32",
17522
+ name: "s"
17523
+ }
17524
+ ]
17525
+ },
17526
+ {
17527
+ type: "error",
17528
+ name: "ERC20InsufficientAllowance",
17529
+ inputs: [
17530
+ {
17531
+ type: "address",
17532
+ name: "spender"
17533
+ },
17534
+ {
17535
+ type: "uint256",
17536
+ name: "allowance"
17537
+ },
17538
+ {
17539
+ type: "uint256",
17540
+ name: "needed"
17541
+ }
17542
+ ]
17543
+ },
17544
+ {
17545
+ type: "error",
17546
+ name: "ERC20InsufficientBalance",
17547
+ inputs: [
17548
+ {
17549
+ type: "address",
17550
+ name: "sender"
17551
+ },
17552
+ {
17553
+ type: "uint256",
17554
+ name: "balance"
17555
+ },
17556
+ {
17557
+ type: "uint256",
17558
+ name: "needed"
17559
+ }
17560
+ ]
17561
+ },
17562
+ {
17563
+ type: "error",
17564
+ name: "ERC20InvalidApprover",
17565
+ inputs: [
17566
+ {
17567
+ type: "address",
17568
+ name: "approver"
17569
+ }
17570
+ ]
17571
+ },
17572
+ {
17573
+ type: "error",
17574
+ name: "ERC20InvalidReceiver",
17575
+ inputs: [
17576
+ {
17577
+ type: "address",
17578
+ name: "receiver"
17579
+ }
17580
+ ]
17581
+ },
17582
+ {
17583
+ type: "error",
17584
+ name: "ERC20InvalidSender",
17585
+ inputs: [
17586
+ {
17587
+ type: "address",
17588
+ name: "sender"
17589
+ }
17590
+ ]
17591
+ },
17592
+ {
17593
+ type: "error",
17594
+ name: "ERC20InvalidSpender",
17595
+ inputs: [
17596
+ {
17597
+ type: "address",
17598
+ name: "spender"
17599
+ }
17600
+ ]
17601
+ },
17602
+ {
17603
+ type: "error",
17604
+ name: "ERC2612ExpiredSignature",
17605
+ inputs: [
17606
+ {
17607
+ type: "uint256",
17608
+ name: "deadline"
17609
+ }
17610
+ ]
17611
+ },
17612
+ {
17613
+ type: "error",
17614
+ name: "ERC2612InvalidSigner",
17615
+ inputs: [
17616
+ {
17617
+ type: "address",
17618
+ name: "signer"
17619
+ },
17620
+ {
17621
+ type: "address",
17622
+ name: "owner"
17623
+ }
17624
+ ]
17625
+ },
17626
+ {
17627
+ type: "error",
17628
+ name: "InvalidAccountNonce",
17629
+ inputs: [
17630
+ {
17631
+ type: "address",
17632
+ name: "account"
17633
+ },
17634
+ {
17635
+ type: "uint256",
17636
+ name: "currentNonce"
17637
+ }
17638
+ ]
17639
+ },
17640
+ {
17641
+ type: "error",
17642
+ name: "InvalidShortString",
17643
+ inputs: []
17644
+ },
17645
+ {
17646
+ type: "error",
17647
+ name: "StringTooLong",
17648
+ inputs: [
17649
+ {
17650
+ type: "string",
17651
+ name: "str"
17652
+ }
17653
+ ]
17654
+ },
17655
+ {
17656
+ type: "event",
17657
+ anonymous: false,
17658
+ name: "Approval",
17659
+ inputs: [
17660
+ {
17661
+ type: "address",
17662
+ name: "owner",
17663
+ indexed: true
17664
+ },
17665
+ {
17666
+ type: "address",
17667
+ name: "spender",
17668
+ indexed: true
17669
+ },
17670
+ {
17671
+ type: "uint256",
17672
+ name: "value",
17673
+ indexed: false
17674
+ }
17675
+ ]
17676
+ },
17677
+ {
17678
+ type: "event",
17679
+ anonymous: false,
17680
+ name: "EIP712DomainChanged",
17681
+ inputs: []
17682
+ },
17683
+ {
17684
+ type: "event",
17685
+ anonymous: false,
17686
+ name: "Transfer",
17687
+ inputs: [
17688
+ {
17689
+ type: "address",
17690
+ name: "from",
17691
+ indexed: true
17692
+ },
17693
+ {
17694
+ type: "address",
17695
+ name: "to",
17696
+ indexed: true
17697
+ },
17698
+ {
17699
+ type: "uint256",
17700
+ name: "value",
17701
+ indexed: false
17702
+ }
17703
+ ]
17704
+ },
17705
+ {
17706
+ type: "function",
17707
+ name: "DOMAIN_SEPARATOR",
17708
+ constant: true,
17709
+ stateMutability: "view",
17710
+ payable: false,
17711
+ inputs: [],
17712
+ outputs: [
17713
+ {
17714
+ type: "bytes32"
17715
+ }
17716
+ ]
17717
+ },
17718
+ {
17719
+ type: "function",
17720
+ name: "allowance",
17721
+ constant: true,
17722
+ stateMutability: "view",
17723
+ payable: false,
17724
+ inputs: [
17725
+ {
17726
+ type: "address",
17727
+ name: "owner"
17728
+ },
17729
+ {
17730
+ type: "address",
17731
+ name: "spender"
17732
+ }
17733
+ ],
17734
+ outputs: [
17735
+ {
17736
+ type: "uint256"
17737
+ }
17738
+ ]
17739
+ },
17740
+ {
17741
+ type: "function",
17742
+ name: "approve",
17743
+ constant: false,
17744
+ payable: false,
17745
+ inputs: [
17746
+ {
17747
+ type: "address",
17748
+ name: "spender"
17749
+ },
17750
+ {
17751
+ type: "uint256",
17752
+ name: "value"
17753
+ }
17754
+ ],
17755
+ outputs: [
17756
+ {
17757
+ type: "bool"
17758
+ }
17759
+ ]
17760
+ },
17761
+ {
17762
+ type: "function",
17763
+ name: "balanceOf",
17764
+ constant: true,
17765
+ stateMutability: "view",
17766
+ payable: false,
17767
+ inputs: [
17768
+ {
17769
+ type: "address",
17770
+ name: "account"
17771
+ }
17772
+ ],
17773
+ outputs: [
17774
+ {
17775
+ type: "uint256"
17776
+ }
17777
+ ]
17778
+ },
17779
+ {
17780
+ type: "function",
17781
+ name: "decimals",
17782
+ constant: true,
17783
+ stateMutability: "view",
17784
+ payable: false,
17785
+ inputs: [],
17786
+ outputs: [
17787
+ {
17788
+ type: "uint8"
17789
+ }
17790
+ ]
17791
+ },
17792
+ {
17793
+ type: "function",
17794
+ name: "eip712Domain",
17795
+ constant: true,
17796
+ stateMutability: "view",
17797
+ payable: false,
17798
+ inputs: [],
17799
+ outputs: [
17800
+ {
17801
+ type: "bytes1",
17802
+ name: "fields"
17803
+ },
17804
+ {
17805
+ type: "string",
17806
+ name: "name"
17807
+ },
17808
+ {
17809
+ type: "string",
17810
+ name: "version"
17811
+ },
17812
+ {
17813
+ type: "uint256",
17814
+ name: "chainId"
17815
+ },
17816
+ {
17817
+ type: "address",
17818
+ name: "verifyingContract"
17819
+ },
17820
+ {
17821
+ type: "bytes32",
17822
+ name: "salt"
17823
+ },
17824
+ {
17825
+ type: "uint256[]",
17826
+ name: "extensions"
17827
+ }
17828
+ ]
17829
+ },
17830
+ {
17831
+ type: "function",
17832
+ name: "mint",
17833
+ constant: false,
17834
+ payable: false,
17835
+ inputs: [
17836
+ {
17837
+ type: "address",
17838
+ name: "to"
17839
+ },
17840
+ {
17841
+ type: "uint256",
17842
+ name: "amount"
17843
+ }
17844
+ ],
17845
+ outputs: []
17846
+ },
17847
+ {
17848
+ type: "function",
17849
+ name: "mintFor",
17850
+ constant: false,
17851
+ payable: false,
17852
+ inputs: [
17853
+ {
17854
+ type: "address",
17855
+ name: "to"
17856
+ },
17857
+ {
17858
+ type: "uint256",
17859
+ name: "amount"
17860
+ }
17861
+ ],
17862
+ outputs: []
17863
+ },
17864
+ {
17865
+ type: "function",
17866
+ name: "name",
17867
+ constant: true,
17868
+ stateMutability: "view",
17869
+ payable: false,
17870
+ inputs: [],
17871
+ outputs: [
17872
+ {
17873
+ type: "string"
17874
+ }
17875
+ ]
17876
+ },
17877
+ {
17878
+ type: "function",
17879
+ name: "nonces",
17880
+ constant: true,
17881
+ stateMutability: "view",
17882
+ payable: false,
17883
+ inputs: [
17884
+ {
17885
+ type: "address",
17886
+ name: "owner"
17887
+ }
17888
+ ],
17889
+ outputs: [
17890
+ {
17891
+ type: "uint256"
17892
+ }
17893
+ ]
17894
+ },
17895
+ {
17896
+ type: "function",
17897
+ name: "permit",
17898
+ constant: false,
17899
+ payable: false,
17900
+ inputs: [
17901
+ {
17902
+ type: "address",
17903
+ name: "owner"
17904
+ },
17905
+ {
17906
+ type: "address",
17907
+ name: "spender"
17908
+ },
17909
+ {
17910
+ type: "uint256",
17911
+ name: "value"
17912
+ },
17913
+ {
17914
+ type: "uint256",
17915
+ name: "deadline"
17916
+ },
17917
+ {
17918
+ type: "uint8",
17919
+ name: "v"
17920
+ },
17921
+ {
17922
+ type: "bytes32",
17923
+ name: "r"
17924
+ },
17925
+ {
17926
+ type: "bytes32",
17927
+ name: "s"
17928
+ }
17929
+ ],
17930
+ outputs: []
17931
+ },
17932
+ {
17933
+ type: "function",
17934
+ name: "symbol",
17935
+ constant: true,
17936
+ stateMutability: "view",
17937
+ payable: false,
17938
+ inputs: [],
17939
+ outputs: [
17940
+ {
17941
+ type: "string"
17942
+ }
17943
+ ]
17944
+ },
17945
+ {
17946
+ type: "function",
17947
+ name: "totalSupply",
17948
+ constant: true,
17949
+ stateMutability: "view",
17950
+ payable: false,
17951
+ inputs: [],
17952
+ outputs: [
17953
+ {
17954
+ type: "uint256"
17955
+ }
17956
+ ]
17957
+ },
17958
+ {
17959
+ type: "function",
17960
+ name: "transfer",
17961
+ constant: false,
17962
+ payable: false,
17963
+ inputs: [
17964
+ {
17965
+ type: "address",
17966
+ name: "to"
17967
+ },
17968
+ {
17969
+ type: "uint256",
17970
+ name: "value"
17971
+ }
17972
+ ],
17973
+ outputs: [
17974
+ {
17975
+ type: "bool"
17976
+ }
17977
+ ]
17978
+ },
17979
+ {
17980
+ type: "function",
17981
+ name: "transferFrom",
17982
+ constant: false,
17983
+ payable: false,
17984
+ inputs: [
17985
+ {
17986
+ type: "address",
17987
+ name: "from"
17988
+ },
17989
+ {
17990
+ type: "address",
17991
+ name: "to"
17992
+ },
17993
+ {
17994
+ type: "uint256",
17995
+ name: "value"
17996
+ }
17997
+ ],
17998
+ outputs: [
17999
+ {
18000
+ type: "bool"
18001
+ }
18002
+ ]
18003
+ }
18004
+ ];
18005
+
17481
18006
  // src/manager/account/index.ts
17482
18007
  var Account = class {
17483
18008
  constructor(configManager, logger, utils) {
@@ -17485,6 +18010,19 @@ var Account = class {
17485
18010
  this.logger = logger;
17486
18011
  this.utils = utils;
17487
18012
  }
18013
+ async getWalletQuoteTokenBalance(quoteAddress) {
18014
+ const config = this.configManager.getConfig();
18015
+ const erc20Contract = new ethers7.Contract(
18016
+ quoteAddress,
18017
+ ERC20Token_default,
18018
+ config.signer
18019
+ );
18020
+ const balance = await erc20Contract.balanceOf(config.signer.getAddress());
18021
+ return {
18022
+ code: 0,
18023
+ data: balance
18024
+ };
18025
+ }
17488
18026
  /**
17489
18027
  * get tradable amount
17490
18028
  */
@@ -17496,8 +18034,22 @@ var Account = class {
17496
18034
  Account_default,
17497
18035
  config.signer
17498
18036
  );
17499
- const assets = await accountContract.getTradableAmount(config.signer.getAddress(), poolId);
17500
- return assets;
18037
+ try {
18038
+ const assets = await accountContract.getTradableAmount(config.signer.getAddress(), poolId);
18039
+ const data = {
18040
+ profitIsReleased: assets[0],
18041
+ freeAmount: assets[1],
18042
+ tradeableProfit: assets[2]
18043
+ };
18044
+ return {
18045
+ code: 0,
18046
+ data
18047
+ };
18048
+ } catch (error) {
18049
+ return {
18050
+ code: -1
18051
+ };
18052
+ }
17501
18053
  }
17502
18054
  async getTradeFlow(params) {
17503
18055
  const accessToken = await this.configManager.getAccessToken();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myx-trade/sdk",
3
- "version": "0.1.7",
3
+ "version": "0.1.15",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"