@optimex-xyz/market-maker-sdk 0.5.1 → 0.5.3

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 CHANGED
@@ -104,12 +104,23 @@ sequenceDiagram
104
104
 
105
105
  ### 2.1. API Environments
106
106
 
107
- | Environment | Description |
108
- | ------------ | -------------------------------------------------------------------- |
109
- | `dev` | Development environment with test networks and staging services |
110
- | `production` | Production environment with mainnet networks and production services |
107
+ | Environment | Description | Base URL |
108
+ | ---------------- | -------------------------------------------------------------------- | ------------------------------------ |
109
+ | `dev` | Development environment with test networks and staging services | `https://api-dev.bitfi.com` |
110
+ | `pre-production` | Pre-production environment with mainnet networks for testing before release | `https://api-preprod.bitfi.com` |
111
+ | `production` | Production environment with mainnet networks and production services | `https://api.bitfi.com` |
111
112
 
112
- Each environment includes specific configuration for backend URLs, RPC endpoints, router addresses, and payment addresses.
113
+ - Solver URLs: Each environment has dedicated API endpoints
114
+
115
+ - RPC Endpoints: L2 RPC endpoints remain the same across all environments
116
+
117
+ - Router Addresses: Smart contract addresses for routing transactions
118
+
119
+ - **Note:** pre-production and production share the same router addresses
120
+
121
+ - Payment Addresses: Addresses used for fee collection and settlement
122
+
123
+ - **Note:** pre-production and production share the same payment addresses
113
124
 
114
125
  ## 3. PMM Backend APIs
115
126
 
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { DeferredTopicFilter, EventFragment, EventLog, TransactionRequest, Typed, ContractTransactionResponse, FunctionFragment, ContractTransaction, LogDescription, BaseContract, ContractRunner, Interface, AddressLike, BigNumberish, BytesLike, Result, Listener, ContractMethod, Provider, Signer as Signer$1, Wallet, TypedDataDomain } from 'ethers';
2
2
  import { z } from 'zod';
3
3
 
4
- type Environment = 'dev' | 'production';
4
+ type Environment = 'dev' | 'prelive' | 'production';
5
5
  interface EnvironmentConfig {
6
6
  backendUrl: string;
7
7
  rpcUrl: string;
@@ -4930,9 +4930,13 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
4930
4930
  amountAfterFees: z.ZodString;
4931
4931
  fromUserAddress: z.ZodString;
4932
4932
  userReceivingAddress: z.ZodString;
4933
+ scriptTimeout: z.ZodNumber;
4933
4934
  protocolFeeInBps: z.ZodString;
4934
- protocolMpcPubkey: z.ZodString;
4935
- protocolMpcAddress: z.ZodString;
4935
+ affiliateFeeInBps: z.ZodString;
4936
+ totalFee: z.ZodString;
4937
+ protocolFee: z.ZodString;
4938
+ affiliateFee: z.ZodString;
4939
+ mpcAssetChainPubkey: z.ZodString;
4936
4940
  bestIndicativeQuote: z.ZodString;
4937
4941
  displayIndicativeQuote: z.ZodString;
4938
4942
  pmmFinalists: z.ZodArray<z.ZodObject<{
@@ -4955,6 +4959,7 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
4955
4959
  pmmFailureStats: z.ZodRecord<z.ZodString, z.ZodNumber>;
4956
4960
  commitedSignature: z.ZodString;
4957
4961
  minAmountOut: z.ZodNull;
4962
+ tradeTimeout: z.ZodNumber;
4958
4963
  userDepositTx: z.ZodString;
4959
4964
  depositVault: z.ZodString;
4960
4965
  paymentBundle: z.ZodObject<{
@@ -4986,12 +4991,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
4986
4991
  state: z.ZodString;
4987
4992
  lastUpdateMsg: z.ZodString;
4988
4993
  version: z.ZodNumber;
4989
- scriptTimeout: z.ZodNumber;
4990
- affiliateFeeInBps: z.ZodString;
4991
- totalFee: z.ZodString;
4992
- protocolFee: z.ZodString;
4993
- affiliateFee: z.ZodString;
4994
- tradeTimeout: z.ZodNumber;
4995
4994
  }, "strip", z.ZodTypeAny, {
4996
4995
  version: number;
4997
4996
  tradeId: string;
@@ -5020,8 +5019,10 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5020
5019
  fromUserAddress: string;
5021
5020
  userReceivingAddress: string;
5022
5021
  protocolFeeInBps: string;
5023
- protocolMpcPubkey: string;
5024
- protocolMpcAddress: string;
5022
+ affiliateFeeInBps: string;
5023
+ protocolFee: string;
5024
+ affiliateFee: string;
5025
+ mpcAssetChainPubkey: string;
5025
5026
  bestIndicativeQuote: string;
5026
5027
  displayIndicativeQuote: string;
5027
5028
  pmmFinalists: {
@@ -5053,9 +5054,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5053
5054
  tradeMakePaymentTx: string;
5054
5055
  state: string;
5055
5056
  lastUpdateMsg: string;
5056
- affiliateFeeInBps: string;
5057
- protocolFee: string;
5058
- affiliateFee: string;
5059
5057
  }, {
5060
5058
  version: number;
5061
5059
  tradeId: string;
@@ -5084,8 +5082,10 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5084
5082
  fromUserAddress: string;
5085
5083
  userReceivingAddress: string;
5086
5084
  protocolFeeInBps: string;
5087
- protocolMpcPubkey: string;
5088
- protocolMpcAddress: string;
5085
+ affiliateFeeInBps: string;
5086
+ protocolFee: string;
5087
+ affiliateFee: string;
5088
+ mpcAssetChainPubkey: string;
5089
5089
  bestIndicativeQuote: string;
5090
5090
  displayIndicativeQuote: string;
5091
5091
  pmmFinalists: {
@@ -5117,9 +5117,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5117
5117
  tradeMakePaymentTx: string;
5118
5118
  state: string;
5119
5119
  lastUpdateMsg: string;
5120
- affiliateFeeInBps: string;
5121
- protocolFee: string;
5122
- affiliateFee: string;
5123
5120
  }>;
5124
5121
  traceId: z.ZodString;
5125
5122
  }, "strip", z.ZodTypeAny, {
@@ -5151,8 +5148,10 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5151
5148
  fromUserAddress: string;
5152
5149
  userReceivingAddress: string;
5153
5150
  protocolFeeInBps: string;
5154
- protocolMpcPubkey: string;
5155
- protocolMpcAddress: string;
5151
+ affiliateFeeInBps: string;
5152
+ protocolFee: string;
5153
+ affiliateFee: string;
5154
+ mpcAssetChainPubkey: string;
5156
5155
  bestIndicativeQuote: string;
5157
5156
  displayIndicativeQuote: string;
5158
5157
  pmmFinalists: {
@@ -5184,9 +5183,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5184
5183
  tradeMakePaymentTx: string;
5185
5184
  state: string;
5186
5185
  lastUpdateMsg: string;
5187
- affiliateFeeInBps: string;
5188
- protocolFee: string;
5189
- affiliateFee: string;
5190
5186
  };
5191
5187
  traceId: string;
5192
5188
  }, {
@@ -5218,8 +5214,10 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5218
5214
  fromUserAddress: string;
5219
5215
  userReceivingAddress: string;
5220
5216
  protocolFeeInBps: string;
5221
- protocolMpcPubkey: string;
5222
- protocolMpcAddress: string;
5217
+ affiliateFeeInBps: string;
5218
+ protocolFee: string;
5219
+ affiliateFee: string;
5220
+ mpcAssetChainPubkey: string;
5223
5221
  bestIndicativeQuote: string;
5224
5222
  displayIndicativeQuote: string;
5225
5223
  pmmFinalists: {
@@ -5251,9 +5249,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5251
5249
  tradeMakePaymentTx: string;
5252
5250
  state: string;
5253
5251
  lastUpdateMsg: string;
5254
- affiliateFeeInBps: string;
5255
- protocolFee: string;
5256
- affiliateFee: string;
5257
5252
  };
5258
5253
  traceId: string;
5259
5254
  }>;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { DeferredTopicFilter, EventFragment, EventLog, TransactionRequest, Typed, ContractTransactionResponse, FunctionFragment, ContractTransaction, LogDescription, BaseContract, ContractRunner, Interface, AddressLike, BigNumberish, BytesLike, Result, Listener, ContractMethod, Provider, Signer as Signer$1, Wallet, TypedDataDomain } from 'ethers';
2
2
  import { z } from 'zod';
3
3
 
4
- type Environment = 'dev' | 'production';
4
+ type Environment = 'dev' | 'prelive' | 'production';
5
5
  interface EnvironmentConfig {
6
6
  backendUrl: string;
7
7
  rpcUrl: string;
@@ -4930,9 +4930,13 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
4930
4930
  amountAfterFees: z.ZodString;
4931
4931
  fromUserAddress: z.ZodString;
4932
4932
  userReceivingAddress: z.ZodString;
4933
+ scriptTimeout: z.ZodNumber;
4933
4934
  protocolFeeInBps: z.ZodString;
4934
- protocolMpcPubkey: z.ZodString;
4935
- protocolMpcAddress: z.ZodString;
4935
+ affiliateFeeInBps: z.ZodString;
4936
+ totalFee: z.ZodString;
4937
+ protocolFee: z.ZodString;
4938
+ affiliateFee: z.ZodString;
4939
+ mpcAssetChainPubkey: z.ZodString;
4936
4940
  bestIndicativeQuote: z.ZodString;
4937
4941
  displayIndicativeQuote: z.ZodString;
4938
4942
  pmmFinalists: z.ZodArray<z.ZodObject<{
@@ -4955,6 +4959,7 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
4955
4959
  pmmFailureStats: z.ZodRecord<z.ZodString, z.ZodNumber>;
4956
4960
  commitedSignature: z.ZodString;
4957
4961
  minAmountOut: z.ZodNull;
4962
+ tradeTimeout: z.ZodNumber;
4958
4963
  userDepositTx: z.ZodString;
4959
4964
  depositVault: z.ZodString;
4960
4965
  paymentBundle: z.ZodObject<{
@@ -4986,12 +4991,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
4986
4991
  state: z.ZodString;
4987
4992
  lastUpdateMsg: z.ZodString;
4988
4993
  version: z.ZodNumber;
4989
- scriptTimeout: z.ZodNumber;
4990
- affiliateFeeInBps: z.ZodString;
4991
- totalFee: z.ZodString;
4992
- protocolFee: z.ZodString;
4993
- affiliateFee: z.ZodString;
4994
- tradeTimeout: z.ZodNumber;
4995
4994
  }, "strip", z.ZodTypeAny, {
4996
4995
  version: number;
4997
4996
  tradeId: string;
@@ -5020,8 +5019,10 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5020
5019
  fromUserAddress: string;
5021
5020
  userReceivingAddress: string;
5022
5021
  protocolFeeInBps: string;
5023
- protocolMpcPubkey: string;
5024
- protocolMpcAddress: string;
5022
+ affiliateFeeInBps: string;
5023
+ protocolFee: string;
5024
+ affiliateFee: string;
5025
+ mpcAssetChainPubkey: string;
5025
5026
  bestIndicativeQuote: string;
5026
5027
  displayIndicativeQuote: string;
5027
5028
  pmmFinalists: {
@@ -5053,9 +5054,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5053
5054
  tradeMakePaymentTx: string;
5054
5055
  state: string;
5055
5056
  lastUpdateMsg: string;
5056
- affiliateFeeInBps: string;
5057
- protocolFee: string;
5058
- affiliateFee: string;
5059
5057
  }, {
5060
5058
  version: number;
5061
5059
  tradeId: string;
@@ -5084,8 +5082,10 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5084
5082
  fromUserAddress: string;
5085
5083
  userReceivingAddress: string;
5086
5084
  protocolFeeInBps: string;
5087
- protocolMpcPubkey: string;
5088
- protocolMpcAddress: string;
5085
+ affiliateFeeInBps: string;
5086
+ protocolFee: string;
5087
+ affiliateFee: string;
5088
+ mpcAssetChainPubkey: string;
5089
5089
  bestIndicativeQuote: string;
5090
5090
  displayIndicativeQuote: string;
5091
5091
  pmmFinalists: {
@@ -5117,9 +5117,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5117
5117
  tradeMakePaymentTx: string;
5118
5118
  state: string;
5119
5119
  lastUpdateMsg: string;
5120
- affiliateFeeInBps: string;
5121
- protocolFee: string;
5122
- affiliateFee: string;
5123
5120
  }>;
5124
5121
  traceId: z.ZodString;
5125
5122
  }, "strip", z.ZodTypeAny, {
@@ -5151,8 +5148,10 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5151
5148
  fromUserAddress: string;
5152
5149
  userReceivingAddress: string;
5153
5150
  protocolFeeInBps: string;
5154
- protocolMpcPubkey: string;
5155
- protocolMpcAddress: string;
5151
+ affiliateFeeInBps: string;
5152
+ protocolFee: string;
5153
+ affiliateFee: string;
5154
+ mpcAssetChainPubkey: string;
5156
5155
  bestIndicativeQuote: string;
5157
5156
  displayIndicativeQuote: string;
5158
5157
  pmmFinalists: {
@@ -5184,9 +5183,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5184
5183
  tradeMakePaymentTx: string;
5185
5184
  state: string;
5186
5185
  lastUpdateMsg: string;
5187
- affiliateFeeInBps: string;
5188
- protocolFee: string;
5189
- affiliateFee: string;
5190
5186
  };
5191
5187
  traceId: string;
5192
5188
  }, {
@@ -5218,8 +5214,10 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5218
5214
  fromUserAddress: string;
5219
5215
  userReceivingAddress: string;
5220
5216
  protocolFeeInBps: string;
5221
- protocolMpcPubkey: string;
5222
- protocolMpcAddress: string;
5217
+ affiliateFeeInBps: string;
5218
+ protocolFee: string;
5219
+ affiliateFee: string;
5220
+ mpcAssetChainPubkey: string;
5223
5221
  bestIndicativeQuote: string;
5224
5222
  displayIndicativeQuote: string;
5225
5223
  pmmFinalists: {
@@ -5251,9 +5249,6 @@ declare const TradeDetailResponseSchema: z.ZodObject<{
5251
5249
  tradeMakePaymentTx: string;
5252
5250
  state: string;
5253
5251
  lastUpdateMsg: string;
5254
- affiliateFeeInBps: string;
5255
- protocolFee: string;
5256
- affiliateFee: string;
5257
5252
  };
5258
5253
  traceId: string;
5259
5254
  }>;
package/dist/index.js CHANGED
@@ -79,6 +79,14 @@ var environments = {
79
79
  ethereum_sepolia: "0x7387DcCfE2f1D5F80b4ECDF91eF58541517e90D2"
80
80
  }
81
81
  },
82
+ prelive: {
83
+ backendUrl: "https://pre-api.optimex.xyz",
84
+ rpcUrl: "https://bitfi-ledger-testnet.alt.technology",
85
+ routerAddress: "0x272599CE3602A49B580A5C4a4d3C1067E30248D2",
86
+ paymentAddressMap: {
87
+ ethereum: "x0A497AC4261E37FA4062762C23Cf3cB642C839b8"
88
+ }
89
+ },
82
90
  production: {
83
91
  backendUrl: "https://api.optimex.xyz",
84
92
  rpcUrl: "https://bitfi-ledger-testnet.alt.technology",
@@ -3864,9 +3872,13 @@ var TradeDetailResponseSchema = import_zod.z.object({
3864
3872
  amountAfterFees: import_zod.z.string(),
3865
3873
  fromUserAddress: import_zod.z.string(),
3866
3874
  userReceivingAddress: import_zod.z.string(),
3875
+ scriptTimeout: import_zod.z.number(),
3867
3876
  protocolFeeInBps: import_zod.z.string(),
3868
- protocolMpcPubkey: import_zod.z.string(),
3869
- protocolMpcAddress: import_zod.z.string(),
3877
+ affiliateFeeInBps: import_zod.z.string(),
3878
+ totalFee: import_zod.z.string(),
3879
+ protocolFee: import_zod.z.string(),
3880
+ affiliateFee: import_zod.z.string(),
3881
+ mpcAssetChainPubkey: import_zod.z.string(),
3870
3882
  bestIndicativeQuote: import_zod.z.string(),
3871
3883
  displayIndicativeQuote: import_zod.z.string(),
3872
3884
  pmmFinalists: import_zod.z.array(PMMFinalistSchema),
@@ -3880,6 +3892,7 @@ var TradeDetailResponseSchema = import_zod.z.object({
3880
3892
  pmmFailureStats: import_zod.z.record(import_zod.z.number()),
3881
3893
  commitedSignature: import_zod.z.string(),
3882
3894
  minAmountOut: import_zod.z.null(),
3895
+ tradeTimeout: import_zod.z.number(),
3883
3896
  userDepositTx: import_zod.z.string(),
3884
3897
  depositVault: import_zod.z.string(),
3885
3898
  paymentBundle: PaymentBundleSchema,
@@ -3889,13 +3902,7 @@ var TradeDetailResponseSchema = import_zod.z.object({
3889
3902
  tradeMakePaymentTx: import_zod.z.string(),
3890
3903
  state: import_zod.z.string(),
3891
3904
  lastUpdateMsg: import_zod.z.string(),
3892
- version: import_zod.z.number(),
3893
- scriptTimeout: import_zod.z.number(),
3894
- affiliateFeeInBps: import_zod.z.string(),
3895
- totalFee: import_zod.z.string(),
3896
- protocolFee: import_zod.z.string(),
3897
- affiliateFee: import_zod.z.string(),
3898
- tradeTimeout: import_zod.z.number()
3905
+ version: import_zod.z.number()
3899
3906
  }),
3900
3907
  traceId: import_zod.z.string()
3901
3908
  });
package/dist/index.mjs CHANGED
@@ -14,6 +14,14 @@ var environments = {
14
14
  ethereum_sepolia: "0x7387DcCfE2f1D5F80b4ECDF91eF58541517e90D2"
15
15
  }
16
16
  },
17
+ prelive: {
18
+ backendUrl: "https://pre-api.optimex.xyz",
19
+ rpcUrl: "https://bitfi-ledger-testnet.alt.technology",
20
+ routerAddress: "0x272599CE3602A49B580A5C4a4d3C1067E30248D2",
21
+ paymentAddressMap: {
22
+ ethereum: "x0A497AC4261E37FA4062762C23Cf3cB642C839b8"
23
+ }
24
+ },
17
25
  production: {
18
26
  backendUrl: "https://api.optimex.xyz",
19
27
  rpcUrl: "https://bitfi-ledger-testnet.alt.technology",
@@ -3799,9 +3807,13 @@ var TradeDetailResponseSchema = z.object({
3799
3807
  amountAfterFees: z.string(),
3800
3808
  fromUserAddress: z.string(),
3801
3809
  userReceivingAddress: z.string(),
3810
+ scriptTimeout: z.number(),
3802
3811
  protocolFeeInBps: z.string(),
3803
- protocolMpcPubkey: z.string(),
3804
- protocolMpcAddress: z.string(),
3812
+ affiliateFeeInBps: z.string(),
3813
+ totalFee: z.string(),
3814
+ protocolFee: z.string(),
3815
+ affiliateFee: z.string(),
3816
+ mpcAssetChainPubkey: z.string(),
3805
3817
  bestIndicativeQuote: z.string(),
3806
3818
  displayIndicativeQuote: z.string(),
3807
3819
  pmmFinalists: z.array(PMMFinalistSchema),
@@ -3815,6 +3827,7 @@ var TradeDetailResponseSchema = z.object({
3815
3827
  pmmFailureStats: z.record(z.number()),
3816
3828
  commitedSignature: z.string(),
3817
3829
  minAmountOut: z.null(),
3830
+ tradeTimeout: z.number(),
3818
3831
  userDepositTx: z.string(),
3819
3832
  depositVault: z.string(),
3820
3833
  paymentBundle: PaymentBundleSchema,
@@ -3824,13 +3837,7 @@ var TradeDetailResponseSchema = z.object({
3824
3837
  tradeMakePaymentTx: z.string(),
3825
3838
  state: z.string(),
3826
3839
  lastUpdateMsg: z.string(),
3827
- version: z.number(),
3828
- scriptTimeout: z.number(),
3829
- affiliateFeeInBps: z.string(),
3830
- totalFee: z.string(),
3831
- protocolFee: z.string(),
3832
- affiliateFee: z.string(),
3833
- tradeTimeout: z.number()
3840
+ version: z.number()
3834
3841
  }),
3835
3842
  traceId: z.string()
3836
3843
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimex-xyz/market-maker-sdk",
3
- "version": "0.5.1",
3
+ "version": "0.5.3",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"