ault-sdk-ts 0.1.0 → 0.3.0
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 +3 -0
- package/dist/core/manifest-resolver.d.ts +18 -8
- package/dist/core/manifest-types.d.ts +2 -0
- package/dist/index.cjs +138 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +124 -12
- package/dist/index.js.map +1 -1
- package/dist/rest/dex-types.generated.d.ts +72 -1
- package/dist/rest/dex.d.ts +1 -0
- package/dist/rest/dex.generated.d.ts +58 -0
- package/dist/ws/types.d.ts +8 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -403,6 +403,9 @@ const orders = await dex.listOrders({
|
|
|
403
403
|
// Single order by ID
|
|
404
404
|
const order = await dex.getOrder("010000000000000000000002");
|
|
405
405
|
|
|
406
|
+
// Single trade by its synthesized ID (block_height-hex(order_id)-open_quantity)
|
|
407
|
+
const trade = await dex.getTrade("12345-00010000000000003039000000000002-999");
|
|
408
|
+
|
|
406
409
|
// User's trade history
|
|
407
410
|
const myTrades = await dex.listMyTrades({
|
|
408
411
|
address: "ault1...",
|
|
@@ -28,18 +28,28 @@ export declare function mergeManifests(base: Manifest | null, top: Manifest | nu
|
|
|
28
28
|
* numerics are pre-validated by `ManifestEip712Schema`.
|
|
29
29
|
*/
|
|
30
30
|
export declare function applyNetworkOverrides(network: NetworkConfig, manifest: Manifest | null): NetworkConfig;
|
|
31
|
+
/**
|
|
32
|
+
* GAS_CONSTANTS keys the manifest is never allowed to override.
|
|
33
|
+
*
|
|
34
|
+
* `EIP712_FEE_AMOUNT`, `EIP712_GAS_LIMIT`, and `DENOM` travel via
|
|
35
|
+
* `ManifestEip712Schema` (`feeAmount`, `gasLimit`, `feeDenom`) and apply
|
|
36
|
+
* through `applyNetworkOverrides` — the broadcast layer reads them off
|
|
37
|
+
* `network.eip712*`, so accepting them in the gas blob would be a silent
|
|
38
|
+
* no-op surface. `EIP712_ANTE_GAS` is a fixed chain-ante constant with no
|
|
39
|
+
* manifest path at all.
|
|
40
|
+
*
|
|
41
|
+
* Single source of truth: `applyGasOverrides` strips these keys, and the
|
|
42
|
+
* schema/baseline parity test derives its exclusion set from this list.
|
|
43
|
+
*/
|
|
44
|
+
export declare const NON_OVERRIDABLE_GAS_KEYS: readonly ["EIP712_FEE_AMOUNT", "EIP712_GAS_LIMIT", "EIP712_ANTE_GAS", "DENOM"];
|
|
31
45
|
/**
|
|
32
46
|
* Returns a GAS_CONSTANTS-shaped object with manifest gas overrides applied.
|
|
33
47
|
*
|
|
34
48
|
* The manifest schema (see `ManifestGasSchema`) only exposes per-msg-type
|
|
35
|
-
* gas and the fee-free multiplier
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* `DENOM`, and `EIP712_ANTE_GAS` so the embedded values stay authoritative for
|
|
40
|
-
* the gas-constants object — the broadcast layer reads the fee/gas/denom off
|
|
41
|
-
* `network.eip712*`, and `EIP712_ANTE_GAS` is a fixed chain-ante constant the
|
|
42
|
-
* manifest is not allowed to override.
|
|
49
|
+
* gas and the fee-free multiplier. As defense in depth (in case a caller
|
|
50
|
+
* bypasses zod and passes a hand-rolled blob), this helper actively drops
|
|
51
|
+
* every `NON_OVERRIDABLE_GAS_KEYS` entry so the embedded values stay
|
|
52
|
+
* authoritative for the gas-constants object.
|
|
43
53
|
*
|
|
44
54
|
* The cast widens the zod-partial back to the concrete `GAS_CONSTANTS` type:
|
|
45
55
|
* every field has a baseline value, so any key the manifest omits keeps the
|
|
@@ -26,6 +26,7 @@ export declare const ManifestGasSchema: z.ZodObject<{
|
|
|
26
26
|
SCALE_ORDER_PER_SUB: z.ZodOptional<z.ZodNumber>;
|
|
27
27
|
CANCEL_ORDER_BASE: z.ZodOptional<z.ZodNumber>;
|
|
28
28
|
CANCEL_ORDER_PER_ID: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
MODIFY_ORDER_PER_ID: z.ZodOptional<z.ZodNumber>;
|
|
29
30
|
OPEN_ACCOUNT: z.ZodOptional<z.ZodNumber>;
|
|
30
31
|
DELEGATE: z.ZodOptional<z.ZodNumber>;
|
|
31
32
|
UNDELEGATE: z.ZodOptional<z.ZodNumber>;
|
|
@@ -77,6 +78,7 @@ export declare const ManifestSchema: z.ZodObject<{
|
|
|
77
78
|
SCALE_ORDER_PER_SUB: z.ZodOptional<z.ZodNumber>;
|
|
78
79
|
CANCEL_ORDER_BASE: z.ZodOptional<z.ZodNumber>;
|
|
79
80
|
CANCEL_ORDER_PER_ID: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
MODIFY_ORDER_PER_ID: z.ZodOptional<z.ZodNumber>;
|
|
80
82
|
OPEN_ACCOUNT: z.ZodOptional<z.ZodNumber>;
|
|
81
83
|
DELEGATE: z.ZodOptional<z.ZodNumber>;
|
|
82
84
|
UNDELEGATE: z.ZodOptional<z.ZodNumber>;
|
package/dist/index.cjs
CHANGED
|
@@ -64,6 +64,8 @@ __export(index_exports, {
|
|
|
64
64
|
GetStatusResponse: () => GetStatusResponse,
|
|
65
65
|
GetTickerParams: () => GetTickerParams,
|
|
66
66
|
GetTickerResponse: () => GetTickerResponse,
|
|
67
|
+
GetTradeParams: () => GetTradeParams,
|
|
68
|
+
GetTradeResponse: () => GetTradeResponse,
|
|
67
69
|
GetTradingFeesResponse: () => GetTradingFeesResponse,
|
|
68
70
|
GetUDFConfigResponse: () => GetUDFConfigResponse,
|
|
69
71
|
GetUDFHistoryQueryParams: () => GetUDFHistoryQueryParams,
|
|
@@ -221,6 +223,16 @@ __export(index_exports, {
|
|
|
221
223
|
getStatsResponseTotalsDepositUsdcVolume24hRegExp: () => getStatsResponseTotalsDepositUsdcVolume24hRegExp,
|
|
222
224
|
getStatsResponseTotalsEstimatedFeeRegExp: () => getStatsResponseTotalsEstimatedFeeRegExp,
|
|
223
225
|
getStatsResponseTotalsQuoteVolumeRegExp: () => getStatsResponseTotalsQuoteVolumeRegExp,
|
|
226
|
+
getTradePathIdMax: () => getTradePathIdMax,
|
|
227
|
+
getTradePathIdRegExp: () => getTradePathIdRegExp,
|
|
228
|
+
getTradeResponseAmountRegExp: () => getTradeResponseAmountRegExp,
|
|
229
|
+
getTradeResponseCostRegExp: () => getTradeResponseCostRegExp,
|
|
230
|
+
getTradeResponseFeeCostRegExp: () => getTradeResponseFeeCostRegExp,
|
|
231
|
+
getTradeResponseFeeRateRegExp: () => getTradeResponseFeeRateRegExp,
|
|
232
|
+
getTradeResponseInfoAddressOneRegExp: () => getTradeResponseInfoAddressOneRegExp,
|
|
233
|
+
getTradeResponseInfoBlockHeightRegExp: () => getTradeResponseInfoBlockHeightRegExp,
|
|
234
|
+
getTradeResponseInfoEventIndexMin: () => getTradeResponseInfoEventIndexMin,
|
|
235
|
+
getTradeResponsePriceRegExp: () => getTradeResponsePriceRegExp,
|
|
224
236
|
getTradingFeesResponseMakerRegExp: () => getTradingFeesResponseMakerRegExp,
|
|
225
237
|
getTradingFeesResponseTakerRegExp: () => getTradingFeesResponseTakerRegExp,
|
|
226
238
|
getUDFHistoryQueryCountbackMax: () => getUDFHistoryQueryCountbackMax,
|
|
@@ -240,6 +252,7 @@ __export(index_exports, {
|
|
|
240
252
|
listMyTradesResponseFeeRateRegExp: () => listMyTradesResponseFeeRateRegExp,
|
|
241
253
|
listMyTradesResponseInfoAddressOneRegExp: () => listMyTradesResponseInfoAddressOneRegExp,
|
|
242
254
|
listMyTradesResponseInfoBlockHeightRegExp: () => listMyTradesResponseInfoBlockHeightRegExp,
|
|
255
|
+
listMyTradesResponseInfoEventIndexMin: () => listMyTradesResponseInfoEventIndexMin,
|
|
243
256
|
listMyTradesResponsePriceRegExp: () => listMyTradesResponsePriceRegExp,
|
|
244
257
|
listOrdersQueryAddressOneRegExp: () => listOrdersQueryAddressOneRegExp,
|
|
245
258
|
listOrdersQueryAddressTwoRegExp: () => listOrdersQueryAddressTwoRegExp,
|
|
@@ -264,6 +277,7 @@ __export(index_exports, {
|
|
|
264
277
|
listTradesResponseFeeRateRegExp: () => listTradesResponseFeeRateRegExp,
|
|
265
278
|
listTradesResponseInfoAddressOneRegExp: () => listTradesResponseInfoAddressOneRegExp,
|
|
266
279
|
listTradesResponseInfoBlockHeightRegExp: () => listTradesResponseInfoBlockHeightRegExp,
|
|
280
|
+
listTradesResponseInfoEventIndexMin: () => listTradesResponseInfoEventIndexMin,
|
|
267
281
|
listTradesResponsePriceRegExp: () => listTradesResponsePriceRegExp,
|
|
268
282
|
mergeManifests: () => mergeManifests,
|
|
269
283
|
msg: () => msg,
|
|
@@ -630,6 +644,8 @@ var NETWORKS = {
|
|
|
630
644
|
restUrl: "https://mainnet-rpc-proxy.aultblockchain.xyz/rest",
|
|
631
645
|
evmRpcUrl: "https://mainnet-rpc-proxy.aultblockchain.xyz/evm",
|
|
632
646
|
explorerUrl: "https://ault.explorer.xangle.io",
|
|
647
|
+
// The dex API lives on its own host, not behind the chain proxy above.
|
|
648
|
+
dexApiUrl: "https://am-api.cloud.aultblockchain.xyz",
|
|
633
649
|
isProduction: true
|
|
634
650
|
},
|
|
635
651
|
"ault_10904-1": {
|
|
@@ -3801,8 +3817,10 @@ function isSet15(value) {
|
|
|
3801
3817
|
}
|
|
3802
3818
|
|
|
3803
3819
|
// src/rest/clob.ts
|
|
3820
|
+
var ORDER_ID_HEX_RE = new RegExp(`^(0[xX])?[0-9a-fA-F]{${ORDER_ID_LENGTH * 2}}$`);
|
|
3804
3821
|
function normalizeOrderId(orderId) {
|
|
3805
|
-
|
|
3822
|
+
if (typeof orderId !== "string") return bytesToBase64(orderId);
|
|
3823
|
+
return ORDER_ID_HEX_RE.test(orderId) ? OrderId.fromHex(orderId).toBase64() : orderId;
|
|
3806
3824
|
}
|
|
3807
3825
|
function normalizeMarketId(marketId) {
|
|
3808
3826
|
return typeof marketId === "string" ? marketId : bytesToBase64(marketId);
|
|
@@ -11001,6 +11019,7 @@ __export(dex_generated_exports, {
|
|
|
11001
11019
|
getGetStatsUrl: () => getGetStatsUrl,
|
|
11002
11020
|
getGetStatusUrl: () => getGetStatusUrl,
|
|
11003
11021
|
getGetTickerUrl: () => getGetTickerUrl,
|
|
11022
|
+
getGetTradeUrl: () => getGetTradeUrl,
|
|
11004
11023
|
getGetTradingFeesUrl: () => getGetTradingFeesUrl,
|
|
11005
11024
|
getGetUDFConfigUrl: () => getGetUDFConfigUrl,
|
|
11006
11025
|
getGetUDFHistoryUrl: () => getGetUDFHistoryUrl,
|
|
@@ -11026,6 +11045,7 @@ __export(dex_generated_exports, {
|
|
|
11026
11045
|
getStats: () => getStats,
|
|
11027
11046
|
getStatus: () => getStatus,
|
|
11028
11047
|
getTicker: () => getTicker,
|
|
11048
|
+
getTrade: () => getTrade,
|
|
11029
11049
|
getTradingFees: () => getTradingFees,
|
|
11030
11050
|
getUDFConfig: () => getUDFConfig,
|
|
11031
11051
|
getUDFHistory: () => getUDFHistory,
|
|
@@ -11268,6 +11288,15 @@ var listTrades = async (symbol, params, options) => {
|
|
|
11268
11288
|
method: "GET"
|
|
11269
11289
|
});
|
|
11270
11290
|
};
|
|
11291
|
+
var getGetTradeUrl = (id) => {
|
|
11292
|
+
return `/api/v1/trade/${id}`;
|
|
11293
|
+
};
|
|
11294
|
+
var getTrade = async (id, options) => {
|
|
11295
|
+
return dexFetch(getGetTradeUrl(id), {
|
|
11296
|
+
...options,
|
|
11297
|
+
method: "GET"
|
|
11298
|
+
});
|
|
11299
|
+
};
|
|
11271
11300
|
var getGetTradingFeesUrl = () => {
|
|
11272
11301
|
return `/api/v1/fees`;
|
|
11273
11302
|
};
|
|
@@ -11542,6 +11571,7 @@ function createDexApi(context) {
|
|
|
11542
11571
|
getOHLCV: bind(context, getOHLCV),
|
|
11543
11572
|
listOrders: bind(context, listOrders),
|
|
11544
11573
|
getOrder: bind(context, getOrder),
|
|
11574
|
+
getTrade: bind(context, getTrade),
|
|
11545
11575
|
listMyTrades: bind(context, listMyTrades),
|
|
11546
11576
|
getBalance: bind(context, getBalance),
|
|
11547
11577
|
getStats: bind(context, getStats),
|
|
@@ -24897,6 +24927,7 @@ var ManifestGasSchema = import_zod.z.object({
|
|
|
24897
24927
|
SCALE_ORDER_PER_SUB: import_zod.z.number().int().positive(),
|
|
24898
24928
|
CANCEL_ORDER_BASE: import_zod.z.number().int().positive(),
|
|
24899
24929
|
CANCEL_ORDER_PER_ID: import_zod.z.number().int().positive(),
|
|
24930
|
+
MODIFY_ORDER_PER_ID: import_zod.z.number().int().positive(),
|
|
24900
24931
|
OPEN_ACCOUNT: import_zod.z.number().int().positive(),
|
|
24901
24932
|
DELEGATE: import_zod.z.number().int().positive(),
|
|
24902
24933
|
UNDELEGATE: import_zod.z.number().int().positive(),
|
|
@@ -24988,17 +25019,18 @@ function applyNetworkOverrides(network, manifest) {
|
|
|
24988
25019
|
...manifest.eip712?.gasLimit != null ? { eip712GasLimit: manifest.eip712.gasLimit } : {}
|
|
24989
25020
|
};
|
|
24990
25021
|
}
|
|
25022
|
+
var NON_OVERRIDABLE_GAS_KEYS = [
|
|
25023
|
+
"EIP712_FEE_AMOUNT",
|
|
25024
|
+
"EIP712_GAS_LIMIT",
|
|
25025
|
+
"EIP712_ANTE_GAS",
|
|
25026
|
+
"DENOM"
|
|
25027
|
+
];
|
|
25028
|
+
var NON_OVERRIDABLE_GAS_KEY_SET = new Set(NON_OVERRIDABLE_GAS_KEYS);
|
|
24991
25029
|
function applyGasOverrides(gas) {
|
|
24992
25030
|
if (!gas) return GAS_CONSTANTS;
|
|
24993
|
-
const {
|
|
24994
|
-
EIP712_FEE_AMOUNT: _ignoredFee,
|
|
24995
|
-
EIP712_GAS_LIMIT: _ignoredGas,
|
|
24996
|
-
DENOM: _ignoredDenom,
|
|
24997
|
-
EIP712_ANTE_GAS: _ignoredAnte,
|
|
24998
|
-
...rest
|
|
24999
|
-
} = gas;
|
|
25000
25031
|
const safeRest = {};
|
|
25001
|
-
for (const [k, v] of Object.entries(
|
|
25032
|
+
for (const [k, v] of Object.entries(gas)) {
|
|
25033
|
+
if (NON_OVERRIDABLE_GAS_KEY_SET.has(k)) continue;
|
|
25002
25034
|
if (typeof v === "number" && Number.isInteger(v) && v > 0) {
|
|
25003
25035
|
safeRest[k] = v;
|
|
25004
25036
|
}
|
|
@@ -25806,6 +25838,7 @@ var listTradesResponseFeeCostRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
|
25806
25838
|
var listTradesResponseFeeRateRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
25807
25839
|
var listTradesResponseInfoAddressOneRegExp = new RegExp("^ault1[a-z0-9]{38,}$");
|
|
25808
25840
|
var listTradesResponseInfoBlockHeightRegExp = new RegExp("^\\d+$");
|
|
25841
|
+
var listTradesResponseInfoEventIndexMin = 0;
|
|
25809
25842
|
var ListTradesResponseItem = zod.object({
|
|
25810
25843
|
id: zod.string(),
|
|
25811
25844
|
order: zod.string().nullish(),
|
|
@@ -25851,7 +25884,10 @@ var ListTradesResponseItem = zod.object({
|
|
|
25851
25884
|
received: zod.string().describe(
|
|
25852
25885
|
"Atto-precision amount the orderer received for this fill,\nsuffixed with the chain denom. Empty string when the chain did\nnot record this side.\n"
|
|
25853
25886
|
),
|
|
25854
|
-
block_height: zod.string().regex(listTradesResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event.")
|
|
25887
|
+
block_height: zod.string().regex(listTradesResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event."),
|
|
25888
|
+
event_index: zod.number().min(listTradesResponseInfoEventIndexMin).describe(
|
|
25889
|
+
"The trade's event position within its block. Together with\n`block_height` it is the row's composite pagination cursor for the\ntrade feed. `created_at` cannot serve this role because every trade\nin a block shares one timestamp.\n"
|
|
25890
|
+
)
|
|
25855
25891
|
}).describe(
|
|
25856
25892
|
"Exchange-specific extension on `TradeResponse`. Mirrors the\n`Info` struct populated in `internal/domain/trade/service.go`.\n"
|
|
25857
25893
|
)
|
|
@@ -25859,6 +25895,78 @@ var ListTradesResponseItem = zod.object({
|
|
|
25859
25895
|
"All numeric fields are canonical decimal strings \u2014 quantities at any\nmagnitude survive the JSON round-trip without rounding through\nfloat64. Consumers parse with their own bigdecimal.\n"
|
|
25860
25896
|
);
|
|
25861
25897
|
var ListTradesResponse = zod.array(ListTradesResponseItem);
|
|
25898
|
+
var getTradePathIdMax = 114;
|
|
25899
|
+
var getTradePathIdRegExp = new RegExp(
|
|
25900
|
+
"^(0|[1-9][0-9]*)-[0-9a-f]{32}-(0|[1-9][0-9]*)(\\.[0-9]*[1-9])?$"
|
|
25901
|
+
);
|
|
25902
|
+
var GetTradeParams = zod.object({
|
|
25903
|
+
id: zod.string().max(getTradePathIdMax).regex(getTradePathIdRegExp).describe(
|
|
25904
|
+
"Synthesized trade id in the form\n`<block_height>-<hex(order_id)>-<open_quantity>`, taken verbatim from\na REST trade object's `id` field (not the WebSocket `tid`).\n"
|
|
25905
|
+
)
|
|
25906
|
+
});
|
|
25907
|
+
var getTradeResponsePriceRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
25908
|
+
var getTradeResponseAmountRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
25909
|
+
var getTradeResponseCostRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
25910
|
+
var getTradeResponseFeeCostRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
25911
|
+
var getTradeResponseFeeRateRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
25912
|
+
var getTradeResponseInfoAddressOneRegExp = new RegExp("^ault1[a-z0-9]{38,}$");
|
|
25913
|
+
var getTradeResponseInfoBlockHeightRegExp = new RegExp("^\\d+$");
|
|
25914
|
+
var getTradeResponseInfoEventIndexMin = 0;
|
|
25915
|
+
var GetTradeResponse = zod.object({
|
|
25916
|
+
id: zod.string(),
|
|
25917
|
+
order: zod.string().nullish(),
|
|
25918
|
+
timestamp: zod.number(),
|
|
25919
|
+
datetime: zod.iso.datetime({}),
|
|
25920
|
+
symbol: zod.string(),
|
|
25921
|
+
type: zod.union([
|
|
25922
|
+
zod.literal("limit"),
|
|
25923
|
+
zod.literal("market"),
|
|
25924
|
+
zod.literal("unknown"),
|
|
25925
|
+
zod.literal(null)
|
|
25926
|
+
]).nullish().describe(
|
|
25927
|
+
"Order type resolved via JOIN to orders table. Null if order not found. `unknown` is the fallback for a chain code the API doesn't recognize."
|
|
25928
|
+
),
|
|
25929
|
+
cloid: zod.string().nullish().describe(
|
|
25930
|
+
"Client order id (hex, 8 bytes) resolved via JOIN to orders table. Null when the order carried none, the row predates cloid indexing, or on the public trades feed (cloids are private to the orderer)."
|
|
25931
|
+
),
|
|
25932
|
+
side: zod.enum(["buy", "sell"]),
|
|
25933
|
+
takerOrMaker: zod.enum(["taker", "maker"]).optional().describe(
|
|
25934
|
+
"Which leg of the match this fill is. Each match writes a maker leg and a taker leg; the public market feed returns only the maker leg so a market's trades aren't double-counted, while the per-orderer feed returns whichever leg belongs to that orderer."
|
|
25935
|
+
),
|
|
25936
|
+
price: zod.string().regex(getTradeResponsePriceRegExp),
|
|
25937
|
+
amount: zod.string().regex(getTradeResponseAmountRegExp),
|
|
25938
|
+
cost: zod.string().regex(getTradeResponseCostRegExp).describe("price * amount"),
|
|
25939
|
+
fee: zod.object({
|
|
25940
|
+
cost: zod.string().regex(getTradeResponseFeeCostRegExp).optional().describe("Fee cost in `currency` units, decimal string."),
|
|
25941
|
+
currency: zod.string().optional().describe(
|
|
25942
|
+
'Ticker of the fee denom (e.g., "USDT", or "AULT" for a base-denom fee). The quote ticker for the rate-estimated fallback.'
|
|
25943
|
+
),
|
|
25944
|
+
rate: zod.string().regex(getTradeResponseFeeRateRegExp).optional().describe(
|
|
25945
|
+
"This leg's fee rate from the market, decimal string: the maker rate for the maker leg, the taker rate otherwise."
|
|
25946
|
+
)
|
|
25947
|
+
}).optional().describe(
|
|
25948
|
+
"Fee charged on the fill. When the indexer recorded a realized fee, cost and currency report it verbatim; the currency follows the denom the filled leg received, which is the base asset on a taker buy, not always the quote. For rows that predate fee indexing, cost falls back to the estimate amount * price * rate in the quote currency, where rate is this leg's rate (maker_fee_rate for the maker leg, otherwise taker_fee_rate)."
|
|
25949
|
+
),
|
|
25950
|
+
info: zod.object({
|
|
25951
|
+
address: zod.string().regex(getTradeResponseInfoAddressOneRegExp).describe(
|
|
25952
|
+
"Cosmos bech32 account address. The HRP is fixed to `ault` for\naccounts (validators use `aultvaloper`, which this schema rejects).\nLowercased and checksum-verified by the API; mixed-case bech32 is\nrejected to avoid silent EIP-55-style ambiguity.\n"
|
|
25953
|
+
).describe("Bech32 address of the orderer that owns this leg of the fill."),
|
|
25954
|
+
paid: zod.string().describe(
|
|
25955
|
+
'Atto-precision amount the orderer paid for this fill, suffixed\nwith the chain denom (e.g. `"1500000000000000000uusdt"`). Empty\nstring when the chain did not record this side.\n'
|
|
25956
|
+
),
|
|
25957
|
+
received: zod.string().describe(
|
|
25958
|
+
"Atto-precision amount the orderer received for this fill,\nsuffixed with the chain denom. Empty string when the chain did\nnot record this side.\n"
|
|
25959
|
+
),
|
|
25960
|
+
block_height: zod.string().regex(getTradeResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event."),
|
|
25961
|
+
event_index: zod.number().min(getTradeResponseInfoEventIndexMin).describe(
|
|
25962
|
+
"The trade's event position within its block. Together with\n`block_height` it is the row's composite pagination cursor for the\ntrade feed. `created_at` cannot serve this role because every trade\nin a block shares one timestamp.\n"
|
|
25963
|
+
)
|
|
25964
|
+
}).describe(
|
|
25965
|
+
"Exchange-specific extension on `TradeResponse`. Mirrors the\n`Info` struct populated in `internal/domain/trade/service.go`.\n"
|
|
25966
|
+
)
|
|
25967
|
+
}).describe(
|
|
25968
|
+
"All numeric fields are canonical decimal strings \u2014 quantities at any\nmagnitude survive the JSON round-trip without rounding through\nfloat64. Consumers parse with their own bigdecimal.\n"
|
|
25969
|
+
);
|
|
25862
25970
|
var getTradingFeesResponseMakerRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
25863
25971
|
var getTradingFeesResponseTakerRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
25864
25972
|
var GetTradingFeesResponse = zod.record(
|
|
@@ -26108,6 +26216,7 @@ var listMyTradesResponseFeeCostRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
|
26108
26216
|
var listMyTradesResponseFeeRateRegExp = new RegExp("^-?\\d+(\\.\\d+)?$");
|
|
26109
26217
|
var listMyTradesResponseInfoAddressOneRegExp = new RegExp("^ault1[a-z0-9]{38,}$");
|
|
26110
26218
|
var listMyTradesResponseInfoBlockHeightRegExp = new RegExp("^\\d+$");
|
|
26219
|
+
var listMyTradesResponseInfoEventIndexMin = 0;
|
|
26111
26220
|
var ListMyTradesResponseItem = zod.object({
|
|
26112
26221
|
id: zod.string(),
|
|
26113
26222
|
order: zod.string().nullish(),
|
|
@@ -26153,7 +26262,10 @@ var ListMyTradesResponseItem = zod.object({
|
|
|
26153
26262
|
received: zod.string().describe(
|
|
26154
26263
|
"Atto-precision amount the orderer received for this fill,\nsuffixed with the chain denom. Empty string when the chain did\nnot record this side.\n"
|
|
26155
26264
|
),
|
|
26156
|
-
block_height: zod.string().regex(listMyTradesResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event.")
|
|
26265
|
+
block_height: zod.string().regex(listMyTradesResponseInfoBlockHeightRegExp).describe("Decimal-string block height for parity with the WS trade event."),
|
|
26266
|
+
event_index: zod.number().min(listMyTradesResponseInfoEventIndexMin).describe(
|
|
26267
|
+
"The trade's event position within its block. Together with\n`block_height` it is the row's composite pagination cursor for the\ntrade feed. `created_at` cannot serve this role because every trade\nin a block shares one timestamp.\n"
|
|
26268
|
+
)
|
|
26157
26269
|
}).describe(
|
|
26158
26270
|
"Exchange-specific extension on `TradeResponse`. Mirrors the\n`Info` struct populated in `internal/domain/trade/service.go`.\n"
|
|
26159
26271
|
)
|
|
@@ -26341,7 +26453,7 @@ function createDexWs(url, options) {
|
|
|
26341
26453
|
}
|
|
26342
26454
|
|
|
26343
26455
|
// src/index.ts
|
|
26344
|
-
var SDK_VERSION = "0.
|
|
26456
|
+
var SDK_VERSION = "0.3.0";
|
|
26345
26457
|
// Annotate the CommonJS export names for ESM import in node:
|
|
26346
26458
|
0 && (module.exports = {
|
|
26347
26459
|
AGENT_DEFAULTS,
|
|
@@ -26378,6 +26490,8 @@ var SDK_VERSION = "0.1.0";
|
|
|
26378
26490
|
GetStatusResponse,
|
|
26379
26491
|
GetTickerParams,
|
|
26380
26492
|
GetTickerResponse,
|
|
26493
|
+
GetTradeParams,
|
|
26494
|
+
GetTradeResponse,
|
|
26381
26495
|
GetTradingFeesResponse,
|
|
26382
26496
|
GetUDFConfigResponse,
|
|
26383
26497
|
GetUDFHistoryQueryParams,
|
|
@@ -26535,6 +26649,16 @@ var SDK_VERSION = "0.1.0";
|
|
|
26535
26649
|
getStatsResponseTotalsDepositUsdcVolume24hRegExp,
|
|
26536
26650
|
getStatsResponseTotalsEstimatedFeeRegExp,
|
|
26537
26651
|
getStatsResponseTotalsQuoteVolumeRegExp,
|
|
26652
|
+
getTradePathIdMax,
|
|
26653
|
+
getTradePathIdRegExp,
|
|
26654
|
+
getTradeResponseAmountRegExp,
|
|
26655
|
+
getTradeResponseCostRegExp,
|
|
26656
|
+
getTradeResponseFeeCostRegExp,
|
|
26657
|
+
getTradeResponseFeeRateRegExp,
|
|
26658
|
+
getTradeResponseInfoAddressOneRegExp,
|
|
26659
|
+
getTradeResponseInfoBlockHeightRegExp,
|
|
26660
|
+
getTradeResponseInfoEventIndexMin,
|
|
26661
|
+
getTradeResponsePriceRegExp,
|
|
26538
26662
|
getTradingFeesResponseMakerRegExp,
|
|
26539
26663
|
getTradingFeesResponseTakerRegExp,
|
|
26540
26664
|
getUDFHistoryQueryCountbackMax,
|
|
@@ -26554,6 +26678,7 @@ var SDK_VERSION = "0.1.0";
|
|
|
26554
26678
|
listMyTradesResponseFeeRateRegExp,
|
|
26555
26679
|
listMyTradesResponseInfoAddressOneRegExp,
|
|
26556
26680
|
listMyTradesResponseInfoBlockHeightRegExp,
|
|
26681
|
+
listMyTradesResponseInfoEventIndexMin,
|
|
26557
26682
|
listMyTradesResponsePriceRegExp,
|
|
26558
26683
|
listOrdersQueryAddressOneRegExp,
|
|
26559
26684
|
listOrdersQueryAddressTwoRegExp,
|
|
@@ -26578,6 +26703,7 @@ var SDK_VERSION = "0.1.0";
|
|
|
26578
26703
|
listTradesResponseFeeRateRegExp,
|
|
26579
26704
|
listTradesResponseInfoAddressOneRegExp,
|
|
26580
26705
|
listTradesResponseInfoBlockHeightRegExp,
|
|
26706
|
+
listTradesResponseInfoEventIndexMin,
|
|
26581
26707
|
listTradesResponsePriceRegExp,
|
|
26582
26708
|
mergeManifests,
|
|
26583
26709
|
msg,
|