@optimex-xyz/market-maker-sdk 0.4.7 → 0.4.9
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/README.md +552 -511
- package/dist/index.d.mts +30 -10
- package/dist/index.d.ts +30 -10
- package/dist/index.js +16 -9
- package/dist/index.mjs +16 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -4719,7 +4719,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4719
4719
|
amountAfterFees: z.ZodString;
|
|
4720
4720
|
fromUserAddress: z.ZodString;
|
|
4721
4721
|
userReceivingAddress: z.ZodString;
|
|
4722
|
-
deadline: z.ZodNumber;
|
|
4723
4722
|
protocolFeeInBps: z.ZodString;
|
|
4724
4723
|
protocolMpcPubkey: z.ZodString;
|
|
4725
4724
|
protocolMpcAddress: z.ZodString;
|
|
@@ -4745,7 +4744,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4745
4744
|
pmmFailureStats: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
4746
4745
|
commitedSignature: z.ZodString;
|
|
4747
4746
|
minAmountOut: z.ZodNull;
|
|
4748
|
-
sessionDeadline: z.ZodNumber;
|
|
4749
4747
|
userDepositTx: z.ZodString;
|
|
4750
4748
|
depositVault: z.ZodString;
|
|
4751
4749
|
paymentBundle: z.ZodObject<{
|
|
@@ -4777,12 +4775,20 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4777
4775
|
state: z.ZodString;
|
|
4778
4776
|
lastUpdateMsg: z.ZodString;
|
|
4779
4777
|
version: z.ZodNumber;
|
|
4778
|
+
scriptTimeout: z.ZodNumber;
|
|
4779
|
+
affiliateFeeInBps: z.ZodString;
|
|
4780
|
+
totalFee: z.ZodString;
|
|
4781
|
+
protocolFee: z.ZodString;
|
|
4782
|
+
affiliateFee: z.ZodString;
|
|
4783
|
+
tradeTimeout: z.ZodNumber;
|
|
4780
4784
|
}, "strip", z.ZodTypeAny, {
|
|
4781
4785
|
version: number;
|
|
4782
|
-
deadline: number;
|
|
4783
4786
|
tradeId: string;
|
|
4787
|
+
totalFee: string;
|
|
4784
4788
|
minAmountOut: null;
|
|
4789
|
+
tradeTimeout: number;
|
|
4785
4790
|
sessionId: string;
|
|
4791
|
+
scriptTimeout: number;
|
|
4786
4792
|
solverAddress: string;
|
|
4787
4793
|
fromToken: {
|
|
4788
4794
|
address: string;
|
|
@@ -4820,7 +4826,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4820
4826
|
commitmentRetries: number;
|
|
4821
4827
|
pmmFailureStats: Record<string, number>;
|
|
4822
4828
|
commitedSignature: string;
|
|
4823
|
-
sessionDeadline: number;
|
|
4824
4829
|
userDepositTx: string;
|
|
4825
4830
|
depositVault: string;
|
|
4826
4831
|
paymentBundle: {
|
|
@@ -4837,12 +4842,17 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4837
4842
|
tradeMakePaymentTx: string;
|
|
4838
4843
|
state: string;
|
|
4839
4844
|
lastUpdateMsg: string;
|
|
4845
|
+
affiliateFeeInBps: string;
|
|
4846
|
+
protocolFee: string;
|
|
4847
|
+
affiliateFee: string;
|
|
4840
4848
|
}, {
|
|
4841
4849
|
version: number;
|
|
4842
|
-
deadline: number;
|
|
4843
4850
|
tradeId: string;
|
|
4851
|
+
totalFee: string;
|
|
4844
4852
|
minAmountOut: null;
|
|
4853
|
+
tradeTimeout: number;
|
|
4845
4854
|
sessionId: string;
|
|
4855
|
+
scriptTimeout: number;
|
|
4846
4856
|
solverAddress: string;
|
|
4847
4857
|
fromToken: {
|
|
4848
4858
|
address: string;
|
|
@@ -4880,7 +4890,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4880
4890
|
commitmentRetries: number;
|
|
4881
4891
|
pmmFailureStats: Record<string, number>;
|
|
4882
4892
|
commitedSignature: string;
|
|
4883
|
-
sessionDeadline: number;
|
|
4884
4893
|
userDepositTx: string;
|
|
4885
4894
|
depositVault: string;
|
|
4886
4895
|
paymentBundle: {
|
|
@@ -4897,15 +4906,20 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4897
4906
|
tradeMakePaymentTx: string;
|
|
4898
4907
|
state: string;
|
|
4899
4908
|
lastUpdateMsg: string;
|
|
4909
|
+
affiliateFeeInBps: string;
|
|
4910
|
+
protocolFee: string;
|
|
4911
|
+
affiliateFee: string;
|
|
4900
4912
|
}>;
|
|
4901
4913
|
traceId: z.ZodString;
|
|
4902
4914
|
}, "strip", z.ZodTypeAny, {
|
|
4903
4915
|
data: {
|
|
4904
4916
|
version: number;
|
|
4905
|
-
deadline: number;
|
|
4906
4917
|
tradeId: string;
|
|
4918
|
+
totalFee: string;
|
|
4907
4919
|
minAmountOut: null;
|
|
4920
|
+
tradeTimeout: number;
|
|
4908
4921
|
sessionId: string;
|
|
4922
|
+
scriptTimeout: number;
|
|
4909
4923
|
solverAddress: string;
|
|
4910
4924
|
fromToken: {
|
|
4911
4925
|
address: string;
|
|
@@ -4943,7 +4957,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4943
4957
|
commitmentRetries: number;
|
|
4944
4958
|
pmmFailureStats: Record<string, number>;
|
|
4945
4959
|
commitedSignature: string;
|
|
4946
|
-
sessionDeadline: number;
|
|
4947
4960
|
userDepositTx: string;
|
|
4948
4961
|
depositVault: string;
|
|
4949
4962
|
paymentBundle: {
|
|
@@ -4960,15 +4973,20 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4960
4973
|
tradeMakePaymentTx: string;
|
|
4961
4974
|
state: string;
|
|
4962
4975
|
lastUpdateMsg: string;
|
|
4976
|
+
affiliateFeeInBps: string;
|
|
4977
|
+
protocolFee: string;
|
|
4978
|
+
affiliateFee: string;
|
|
4963
4979
|
};
|
|
4964
4980
|
traceId: string;
|
|
4965
4981
|
}, {
|
|
4966
4982
|
data: {
|
|
4967
4983
|
version: number;
|
|
4968
|
-
deadline: number;
|
|
4969
4984
|
tradeId: string;
|
|
4985
|
+
totalFee: string;
|
|
4970
4986
|
minAmountOut: null;
|
|
4987
|
+
tradeTimeout: number;
|
|
4971
4988
|
sessionId: string;
|
|
4989
|
+
scriptTimeout: number;
|
|
4972
4990
|
solverAddress: string;
|
|
4973
4991
|
fromToken: {
|
|
4974
4992
|
address: string;
|
|
@@ -5006,7 +5024,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
5006
5024
|
commitmentRetries: number;
|
|
5007
5025
|
pmmFailureStats: Record<string, number>;
|
|
5008
5026
|
commitedSignature: string;
|
|
5009
|
-
sessionDeadline: number;
|
|
5010
5027
|
userDepositTx: string;
|
|
5011
5028
|
depositVault: string;
|
|
5012
5029
|
paymentBundle: {
|
|
@@ -5023,6 +5040,9 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
5023
5040
|
tradeMakePaymentTx: string;
|
|
5024
5041
|
state: string;
|
|
5025
5042
|
lastUpdateMsg: string;
|
|
5043
|
+
affiliateFeeInBps: string;
|
|
5044
|
+
protocolFee: string;
|
|
5045
|
+
affiliateFee: string;
|
|
5026
5046
|
};
|
|
5027
5047
|
traceId: string;
|
|
5028
5048
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -4719,7 +4719,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4719
4719
|
amountAfterFees: z.ZodString;
|
|
4720
4720
|
fromUserAddress: z.ZodString;
|
|
4721
4721
|
userReceivingAddress: z.ZodString;
|
|
4722
|
-
deadline: z.ZodNumber;
|
|
4723
4722
|
protocolFeeInBps: z.ZodString;
|
|
4724
4723
|
protocolMpcPubkey: z.ZodString;
|
|
4725
4724
|
protocolMpcAddress: z.ZodString;
|
|
@@ -4745,7 +4744,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4745
4744
|
pmmFailureStats: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
4746
4745
|
commitedSignature: z.ZodString;
|
|
4747
4746
|
minAmountOut: z.ZodNull;
|
|
4748
|
-
sessionDeadline: z.ZodNumber;
|
|
4749
4747
|
userDepositTx: z.ZodString;
|
|
4750
4748
|
depositVault: z.ZodString;
|
|
4751
4749
|
paymentBundle: z.ZodObject<{
|
|
@@ -4777,12 +4775,20 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4777
4775
|
state: z.ZodString;
|
|
4778
4776
|
lastUpdateMsg: z.ZodString;
|
|
4779
4777
|
version: z.ZodNumber;
|
|
4778
|
+
scriptTimeout: z.ZodNumber;
|
|
4779
|
+
affiliateFeeInBps: z.ZodString;
|
|
4780
|
+
totalFee: z.ZodString;
|
|
4781
|
+
protocolFee: z.ZodString;
|
|
4782
|
+
affiliateFee: z.ZodString;
|
|
4783
|
+
tradeTimeout: z.ZodNumber;
|
|
4780
4784
|
}, "strip", z.ZodTypeAny, {
|
|
4781
4785
|
version: number;
|
|
4782
|
-
deadline: number;
|
|
4783
4786
|
tradeId: string;
|
|
4787
|
+
totalFee: string;
|
|
4784
4788
|
minAmountOut: null;
|
|
4789
|
+
tradeTimeout: number;
|
|
4785
4790
|
sessionId: string;
|
|
4791
|
+
scriptTimeout: number;
|
|
4786
4792
|
solverAddress: string;
|
|
4787
4793
|
fromToken: {
|
|
4788
4794
|
address: string;
|
|
@@ -4820,7 +4826,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4820
4826
|
commitmentRetries: number;
|
|
4821
4827
|
pmmFailureStats: Record<string, number>;
|
|
4822
4828
|
commitedSignature: string;
|
|
4823
|
-
sessionDeadline: number;
|
|
4824
4829
|
userDepositTx: string;
|
|
4825
4830
|
depositVault: string;
|
|
4826
4831
|
paymentBundle: {
|
|
@@ -4837,12 +4842,17 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4837
4842
|
tradeMakePaymentTx: string;
|
|
4838
4843
|
state: string;
|
|
4839
4844
|
lastUpdateMsg: string;
|
|
4845
|
+
affiliateFeeInBps: string;
|
|
4846
|
+
protocolFee: string;
|
|
4847
|
+
affiliateFee: string;
|
|
4840
4848
|
}, {
|
|
4841
4849
|
version: number;
|
|
4842
|
-
deadline: number;
|
|
4843
4850
|
tradeId: string;
|
|
4851
|
+
totalFee: string;
|
|
4844
4852
|
minAmountOut: null;
|
|
4853
|
+
tradeTimeout: number;
|
|
4845
4854
|
sessionId: string;
|
|
4855
|
+
scriptTimeout: number;
|
|
4846
4856
|
solverAddress: string;
|
|
4847
4857
|
fromToken: {
|
|
4848
4858
|
address: string;
|
|
@@ -4880,7 +4890,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4880
4890
|
commitmentRetries: number;
|
|
4881
4891
|
pmmFailureStats: Record<string, number>;
|
|
4882
4892
|
commitedSignature: string;
|
|
4883
|
-
sessionDeadline: number;
|
|
4884
4893
|
userDepositTx: string;
|
|
4885
4894
|
depositVault: string;
|
|
4886
4895
|
paymentBundle: {
|
|
@@ -4897,15 +4906,20 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4897
4906
|
tradeMakePaymentTx: string;
|
|
4898
4907
|
state: string;
|
|
4899
4908
|
lastUpdateMsg: string;
|
|
4909
|
+
affiliateFeeInBps: string;
|
|
4910
|
+
protocolFee: string;
|
|
4911
|
+
affiliateFee: string;
|
|
4900
4912
|
}>;
|
|
4901
4913
|
traceId: z.ZodString;
|
|
4902
4914
|
}, "strip", z.ZodTypeAny, {
|
|
4903
4915
|
data: {
|
|
4904
4916
|
version: number;
|
|
4905
|
-
deadline: number;
|
|
4906
4917
|
tradeId: string;
|
|
4918
|
+
totalFee: string;
|
|
4907
4919
|
minAmountOut: null;
|
|
4920
|
+
tradeTimeout: number;
|
|
4908
4921
|
sessionId: string;
|
|
4922
|
+
scriptTimeout: number;
|
|
4909
4923
|
solverAddress: string;
|
|
4910
4924
|
fromToken: {
|
|
4911
4925
|
address: string;
|
|
@@ -4943,7 +4957,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4943
4957
|
commitmentRetries: number;
|
|
4944
4958
|
pmmFailureStats: Record<string, number>;
|
|
4945
4959
|
commitedSignature: string;
|
|
4946
|
-
sessionDeadline: number;
|
|
4947
4960
|
userDepositTx: string;
|
|
4948
4961
|
depositVault: string;
|
|
4949
4962
|
paymentBundle: {
|
|
@@ -4960,15 +4973,20 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
4960
4973
|
tradeMakePaymentTx: string;
|
|
4961
4974
|
state: string;
|
|
4962
4975
|
lastUpdateMsg: string;
|
|
4976
|
+
affiliateFeeInBps: string;
|
|
4977
|
+
protocolFee: string;
|
|
4978
|
+
affiliateFee: string;
|
|
4963
4979
|
};
|
|
4964
4980
|
traceId: string;
|
|
4965
4981
|
}, {
|
|
4966
4982
|
data: {
|
|
4967
4983
|
version: number;
|
|
4968
|
-
deadline: number;
|
|
4969
4984
|
tradeId: string;
|
|
4985
|
+
totalFee: string;
|
|
4970
4986
|
minAmountOut: null;
|
|
4987
|
+
tradeTimeout: number;
|
|
4971
4988
|
sessionId: string;
|
|
4989
|
+
scriptTimeout: number;
|
|
4972
4990
|
solverAddress: string;
|
|
4973
4991
|
fromToken: {
|
|
4974
4992
|
address: string;
|
|
@@ -5006,7 +5024,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
5006
5024
|
commitmentRetries: number;
|
|
5007
5025
|
pmmFailureStats: Record<string, number>;
|
|
5008
5026
|
commitedSignature: string;
|
|
5009
|
-
sessionDeadline: number;
|
|
5010
5027
|
userDepositTx: string;
|
|
5011
5028
|
depositVault: string;
|
|
5012
5029
|
paymentBundle: {
|
|
@@ -5023,6 +5040,9 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
|
|
|
5023
5040
|
tradeMakePaymentTx: string;
|
|
5024
5041
|
state: string;
|
|
5025
5042
|
lastUpdateMsg: string;
|
|
5043
|
+
affiliateFeeInBps: string;
|
|
5044
|
+
protocolFee: string;
|
|
5045
|
+
affiliateFee: string;
|
|
5026
5046
|
};
|
|
5027
5047
|
traceId: string;
|
|
5028
5048
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -3703,7 +3703,6 @@ var TradeDetailResponseSchema = import_zod.z.object({
|
|
|
3703
3703
|
amountAfterFees: import_zod.z.string(),
|
|
3704
3704
|
fromUserAddress: import_zod.z.string(),
|
|
3705
3705
|
userReceivingAddress: import_zod.z.string(),
|
|
3706
|
-
deadline: import_zod.z.number(),
|
|
3707
3706
|
protocolFeeInBps: import_zod.z.string(),
|
|
3708
3707
|
protocolMpcPubkey: import_zod.z.string(),
|
|
3709
3708
|
protocolMpcAddress: import_zod.z.string(),
|
|
@@ -3720,7 +3719,6 @@ var TradeDetailResponseSchema = import_zod.z.object({
|
|
|
3720
3719
|
pmmFailureStats: import_zod.z.record(import_zod.z.number()),
|
|
3721
3720
|
commitedSignature: import_zod.z.string(),
|
|
3722
3721
|
minAmountOut: import_zod.z.null(),
|
|
3723
|
-
sessionDeadline: import_zod.z.number(),
|
|
3724
3722
|
userDepositTx: import_zod.z.string(),
|
|
3725
3723
|
depositVault: import_zod.z.string(),
|
|
3726
3724
|
paymentBundle: PaymentBundleSchema,
|
|
@@ -3730,7 +3728,13 @@ var TradeDetailResponseSchema = import_zod.z.object({
|
|
|
3730
3728
|
tradeMakePaymentTx: import_zod.z.string(),
|
|
3731
3729
|
state: import_zod.z.string(),
|
|
3732
3730
|
lastUpdateMsg: import_zod.z.string(),
|
|
3733
|
-
version: import_zod.z.number()
|
|
3731
|
+
version: import_zod.z.number(),
|
|
3732
|
+
scriptTimeout: import_zod.z.number(),
|
|
3733
|
+
affiliateFeeInBps: import_zod.z.string(),
|
|
3734
|
+
totalFee: import_zod.z.string(),
|
|
3735
|
+
protocolFee: import_zod.z.string(),
|
|
3736
|
+
affiliateFee: import_zod.z.string(),
|
|
3737
|
+
tradeTimeout: import_zod.z.number()
|
|
3734
3738
|
}),
|
|
3735
3739
|
traceId: import_zod.z.string()
|
|
3736
3740
|
});
|
|
@@ -3757,7 +3761,7 @@ var SolverService = class {
|
|
|
3757
3761
|
SubmitSettlementRequestSchema.parse(params);
|
|
3758
3762
|
const snakeCaseParams = convertToSnakeCase(params);
|
|
3759
3763
|
const response = await import_axios.default.post(
|
|
3760
|
-
`${this.baseURL}/market-maker/submit-settlement-tx`,
|
|
3764
|
+
`${this.baseURL}/v1/market-maker/submit-settlement-tx`,
|
|
3761
3765
|
snakeCaseParams,
|
|
3762
3766
|
{
|
|
3763
3767
|
headers: {
|
|
@@ -3769,7 +3773,8 @@ var SolverService = class {
|
|
|
3769
3773
|
return SubmitSettlementResponseSchema.parse(response.data);
|
|
3770
3774
|
} catch (error) {
|
|
3771
3775
|
if (import_axios.default.isAxiosError(error)) {
|
|
3772
|
-
|
|
3776
|
+
const errorMessage = error.response?.data?.message || error.response?.data?.error || error.message;
|
|
3777
|
+
throw new Error(errorMessage);
|
|
3773
3778
|
}
|
|
3774
3779
|
if (error instanceof import_zod.z.ZodError) {
|
|
3775
3780
|
throw new Error(`Invalid data: ${error.message}`);
|
|
@@ -3785,7 +3790,7 @@ var SolverService = class {
|
|
|
3785
3790
|
*/
|
|
3786
3791
|
async getTradeDetail(tradeId) {
|
|
3787
3792
|
try {
|
|
3788
|
-
const response = await import_axios.default.get(`${this.baseURL}/market-maker/trades/${tradeId}`, {
|
|
3793
|
+
const response = await import_axios.default.get(`${this.baseURL}/v1/market-maker/trades/${tradeId}`, {
|
|
3789
3794
|
headers: {
|
|
3790
3795
|
"Content-Type": "application/json",
|
|
3791
3796
|
Accept: "application/json"
|
|
@@ -3795,7 +3800,8 @@ var SolverService = class {
|
|
|
3795
3800
|
return TradeDetailResponseSchema.parse(camelCaseData);
|
|
3796
3801
|
} catch (error) {
|
|
3797
3802
|
if (import_axios.default.isAxiosError(error)) {
|
|
3798
|
-
|
|
3803
|
+
const errorMessage = error.response?.data?.message || error.response?.data?.error || error.message;
|
|
3804
|
+
throw new Error(errorMessage);
|
|
3799
3805
|
}
|
|
3800
3806
|
if (error instanceof import_zod.z.ZodError) {
|
|
3801
3807
|
throw new Error(`Invalid data: ${error.message}`);
|
|
@@ -3852,7 +3858,7 @@ var TokenService = class {
|
|
|
3852
3858
|
*/
|
|
3853
3859
|
async getTokens() {
|
|
3854
3860
|
try {
|
|
3855
|
-
const response = await import_axios2.default.get(`${this.baseURL}/market-maker/tokens`, {
|
|
3861
|
+
const response = await import_axios2.default.get(`${this.baseURL}/v1/market-maker/tokens`, {
|
|
3856
3862
|
headers: {
|
|
3857
3863
|
Accept: "application/json"
|
|
3858
3864
|
}
|
|
@@ -3862,7 +3868,8 @@ var TokenService = class {
|
|
|
3862
3868
|
return validatedResponse.data.tokens;
|
|
3863
3869
|
} catch (error) {
|
|
3864
3870
|
if (import_axios2.default.isAxiosError(error)) {
|
|
3865
|
-
|
|
3871
|
+
const errorMessage = error.response?.data?.message || error.response?.data?.error || error.message;
|
|
3872
|
+
throw new Error(errorMessage);
|
|
3866
3873
|
}
|
|
3867
3874
|
if (error instanceof import_zod3.z.ZodError) {
|
|
3868
3875
|
throw new Error(`Invalid token data received: ${error.message}`);
|
package/dist/index.mjs
CHANGED
|
@@ -3638,7 +3638,6 @@ var TradeDetailResponseSchema = z.object({
|
|
|
3638
3638
|
amountAfterFees: z.string(),
|
|
3639
3639
|
fromUserAddress: z.string(),
|
|
3640
3640
|
userReceivingAddress: z.string(),
|
|
3641
|
-
deadline: z.number(),
|
|
3642
3641
|
protocolFeeInBps: z.string(),
|
|
3643
3642
|
protocolMpcPubkey: z.string(),
|
|
3644
3643
|
protocolMpcAddress: z.string(),
|
|
@@ -3655,7 +3654,6 @@ var TradeDetailResponseSchema = z.object({
|
|
|
3655
3654
|
pmmFailureStats: z.record(z.number()),
|
|
3656
3655
|
commitedSignature: z.string(),
|
|
3657
3656
|
minAmountOut: z.null(),
|
|
3658
|
-
sessionDeadline: z.number(),
|
|
3659
3657
|
userDepositTx: z.string(),
|
|
3660
3658
|
depositVault: z.string(),
|
|
3661
3659
|
paymentBundle: PaymentBundleSchema,
|
|
@@ -3665,7 +3663,13 @@ var TradeDetailResponseSchema = z.object({
|
|
|
3665
3663
|
tradeMakePaymentTx: z.string(),
|
|
3666
3664
|
state: z.string(),
|
|
3667
3665
|
lastUpdateMsg: z.string(),
|
|
3668
|
-
version: z.number()
|
|
3666
|
+
version: z.number(),
|
|
3667
|
+
scriptTimeout: z.number(),
|
|
3668
|
+
affiliateFeeInBps: z.string(),
|
|
3669
|
+
totalFee: z.string(),
|
|
3670
|
+
protocolFee: z.string(),
|
|
3671
|
+
affiliateFee: z.string(),
|
|
3672
|
+
tradeTimeout: z.number()
|
|
3669
3673
|
}),
|
|
3670
3674
|
traceId: z.string()
|
|
3671
3675
|
});
|
|
@@ -3692,7 +3696,7 @@ var SolverService = class {
|
|
|
3692
3696
|
SubmitSettlementRequestSchema.parse(params);
|
|
3693
3697
|
const snakeCaseParams = convertToSnakeCase(params);
|
|
3694
3698
|
const response = await axios.post(
|
|
3695
|
-
`${this.baseURL}/market-maker/submit-settlement-tx`,
|
|
3699
|
+
`${this.baseURL}/v1/market-maker/submit-settlement-tx`,
|
|
3696
3700
|
snakeCaseParams,
|
|
3697
3701
|
{
|
|
3698
3702
|
headers: {
|
|
@@ -3704,7 +3708,8 @@ var SolverService = class {
|
|
|
3704
3708
|
return SubmitSettlementResponseSchema.parse(response.data);
|
|
3705
3709
|
} catch (error) {
|
|
3706
3710
|
if (axios.isAxiosError(error)) {
|
|
3707
|
-
|
|
3711
|
+
const errorMessage = error.response?.data?.message || error.response?.data?.error || error.message;
|
|
3712
|
+
throw new Error(errorMessage);
|
|
3708
3713
|
}
|
|
3709
3714
|
if (error instanceof z.ZodError) {
|
|
3710
3715
|
throw new Error(`Invalid data: ${error.message}`);
|
|
@@ -3720,7 +3725,7 @@ var SolverService = class {
|
|
|
3720
3725
|
*/
|
|
3721
3726
|
async getTradeDetail(tradeId) {
|
|
3722
3727
|
try {
|
|
3723
|
-
const response = await axios.get(`${this.baseURL}/market-maker/trades/${tradeId}`, {
|
|
3728
|
+
const response = await axios.get(`${this.baseURL}/v1/market-maker/trades/${tradeId}`, {
|
|
3724
3729
|
headers: {
|
|
3725
3730
|
"Content-Type": "application/json",
|
|
3726
3731
|
Accept: "application/json"
|
|
@@ -3730,7 +3735,8 @@ var SolverService = class {
|
|
|
3730
3735
|
return TradeDetailResponseSchema.parse(camelCaseData);
|
|
3731
3736
|
} catch (error) {
|
|
3732
3737
|
if (axios.isAxiosError(error)) {
|
|
3733
|
-
|
|
3738
|
+
const errorMessage = error.response?.data?.message || error.response?.data?.error || error.message;
|
|
3739
|
+
throw new Error(errorMessage);
|
|
3734
3740
|
}
|
|
3735
3741
|
if (error instanceof z.ZodError) {
|
|
3736
3742
|
throw new Error(`Invalid data: ${error.message}`);
|
|
@@ -3787,7 +3793,7 @@ var TokenService = class {
|
|
|
3787
3793
|
*/
|
|
3788
3794
|
async getTokens() {
|
|
3789
3795
|
try {
|
|
3790
|
-
const response = await axios2.get(`${this.baseURL}/market-maker/tokens`, {
|
|
3796
|
+
const response = await axios2.get(`${this.baseURL}/v1/market-maker/tokens`, {
|
|
3791
3797
|
headers: {
|
|
3792
3798
|
Accept: "application/json"
|
|
3793
3799
|
}
|
|
@@ -3797,7 +3803,8 @@ var TokenService = class {
|
|
|
3797
3803
|
return validatedResponse.data.tokens;
|
|
3798
3804
|
} catch (error) {
|
|
3799
3805
|
if (axios2.isAxiosError(error)) {
|
|
3800
|
-
|
|
3806
|
+
const errorMessage = error.response?.data?.message || error.response?.data?.error || error.message;
|
|
3807
|
+
throw new Error(errorMessage);
|
|
3801
3808
|
}
|
|
3802
3809
|
if (error instanceof z3.ZodError) {
|
|
3803
3810
|
throw new Error(`Invalid token data received: ${error.message}`);
|