@optimex-xyz/market-maker-sdk 0.6.2 → 0.7.0-dev-f98f06c

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
@@ -123,7 +123,11 @@ Provides an indicative quote for the given token pair and trade amount. The quot
123
123
  - **Query Parameters**:
124
124
  - `from_token_id` (string): The ID of the source token.
125
125
  - `to_token_id` (string): The ID of the destination token.
126
- - `amount` (string): The amount of the source token to be traded, represented as a string in base 10 to accommodate large numbers. This should be treated as a BigInt in your implementation.
126
+ - `amount` (string): The amount of the source token to be traded, represented as a string in base 10 to accommodate large numbers.
127
+ - `session_id` (string, optional): A unique identifier for the session.
128
+ - `deposited` (boolean, optional): Whether the deposit has been confirmed. This allows the PMM to decide the returned quote.
129
+ - `trade_timeout` (string, optional): The deadline when user is expected to receive tokens from PMM in UNIX timestamp. We expect the trade to be completed before this timeout. But if not, some actions can still be taken.
130
+ - `script_timeout` (string, optional): The hard timeout for the trade, UNIX timestamp. After this timeout, the trade will not be processed further.
127
131
 
128
132
  #### Example Request
129
133
 
@@ -741,7 +745,7 @@ Allows the PMM to submit settlement transaction hashes for trades. This endpoint
741
745
  - **For EVM Chains:**
742
746
  - Use the transaction hash directly without additional encoding
743
747
  - Example: `settlement_tx`: [0x7a87d2c423e13533b5ae0ecc5af900a7b697048103f4f6e32d19edde5e707355](https://etherscan.io/tx/0x7a87d2c423e13533b5ae0ecc5af900a7b697048103f4f6e32d19edde5e707355)
744
-
748
+
745
749
  - **For Bitcoin or Solana:**
746
750
  - Must encode raw_tx string using the `l2Encode` function
747
751
  - Example raw_tx string: `3d83c7846d6e5b04279175a9592705a15373f3029b866d5224cc0744489fe403`
@@ -758,10 +762,10 @@ import { ethers, toUtf8Bytes, toUtf8String } from 'ethers'
758
762
 
759
763
  export const l2Encode = (info: string) => {
760
764
  // Helper function to ensure hex prefix
761
- const ensureHexPrefix = (value: string) => {
765
+ const ensureHexPrefix = (value: string) => {
762
766
  return value.startsWith('0x') ? value : `0x${value}`
763
767
  }
764
-
768
+
765
769
  if (/^0x[0-9a-fA-F]*$/.test(info)) {
766
770
  return info
767
771
  }
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' | 'prelive' | 'production';
4
+ type Environment = 'dev' | 'prelive' | 'production' | 'staging';
5
5
  interface EnvironmentConfig {
6
6
  backendUrl: string;
7
7
  rpcUrl: string;
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' | 'prelive' | 'production';
4
+ type Environment = 'dev' | 'prelive' | 'production' | 'staging';
5
5
  interface EnvironmentConfig {
6
6
  backendUrl: string;
7
7
  rpcUrl: string;
package/dist/index.js CHANGED
@@ -72,6 +72,14 @@ module.exports = __toCommonJS(index_exports);
72
72
  // src/config/config.ts
73
73
  var environments = {
74
74
  dev: {
75
+ backendUrl: "https://api-dev.bitdex.xyz",
76
+ rpcUrl: "https://rpc-bitfi-p00c4t1rul.t.conduit.xyz",
77
+ routerAddress: "0x193501E5F72a42DACCF8Eb1C4AB37561c213309D",
78
+ paymentAddressMap: {
79
+ ethereum_sepolia: "0x7387DcCfE2f1D5F80b4ECDF91eF58541517e90D2"
80
+ }
81
+ },
82
+ staging: {
75
83
  backendUrl: "https://api-stg.bitdex.xyz",
76
84
  rpcUrl: "https://rpc-bitfi-p00c4t1rul.t.conduit.xyz",
77
85
  routerAddress: "0x193501E5F72a42DACCF8Eb1C4AB37561c213309D",
package/dist/index.mjs CHANGED
@@ -7,6 +7,14 @@ var __export = (target, all) => {
7
7
  // src/config/config.ts
8
8
  var environments = {
9
9
  dev: {
10
+ backendUrl: "https://api-dev.bitdex.xyz",
11
+ rpcUrl: "https://rpc-bitfi-p00c4t1rul.t.conduit.xyz",
12
+ routerAddress: "0x193501E5F72a42DACCF8Eb1C4AB37561c213309D",
13
+ paymentAddressMap: {
14
+ ethereum_sepolia: "0x7387DcCfE2f1D5F80b4ECDF91eF58541517e90D2"
15
+ }
16
+ },
17
+ staging: {
10
18
  backendUrl: "https://api-stg.bitdex.xyz",
11
19
  rpcUrl: "https://rpc-bitfi-p00c4t1rul.t.conduit.xyz",
12
20
  routerAddress: "0x193501E5F72a42DACCF8Eb1C4AB37561c213309D",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@optimex-xyz/market-maker-sdk",
3
- "version": "0.6.2",
3
+ "version": "0.7.0-dev-f98f06c",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"