ault-sdk-ts 0.3.0 → 0.4.1
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/core/clob-gas.d.ts +5 -19
- package/dist/core/manifest-resolver.d.ts +2 -3
- package/dist/core/network.d.ts +0 -9
- package/dist/index.cjs +16 -38
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16 -38
- package/dist/index.js.map +1 -1
- package/dist/ws/types.d.ts +15 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -347,9 +347,7 @@ var NETWORKS = {
|
|
|
347
347
|
rpcUrl: "https://mainnet-rpc-proxy.aultblockchain.xyz/cosmos-rpc",
|
|
348
348
|
restUrl: "https://mainnet-rpc-proxy.aultblockchain.xyz/rest",
|
|
349
349
|
evmRpcUrl: "https://mainnet-rpc-proxy.aultblockchain.xyz/evm",
|
|
350
|
-
explorerUrl: "https://ault.explorer.
|
|
351
|
-
// The dex API lives on its own host, not behind the chain proxy above.
|
|
352
|
-
dexApiUrl: "https://am-api.cloud.aultblockchain.xyz",
|
|
350
|
+
explorerUrl: "https://ault.explorer.orynt.tech",
|
|
353
351
|
isProduction: true
|
|
354
352
|
},
|
|
355
353
|
"ault_10904-1": {
|
|
@@ -360,7 +358,7 @@ var NETWORKS = {
|
|
|
360
358
|
rpcUrl: "https://test-rpc.cloud.aultblockchain.xyz",
|
|
361
359
|
restUrl: "https://test-api.cloud.aultblockchain.xyz",
|
|
362
360
|
evmRpcUrl: "https://test-json-rpc.cloud.aultblockchain.xyz",
|
|
363
|
-
explorerUrl: "https://testnet
|
|
361
|
+
explorerUrl: "https://ault-testnet.explorer.orynt.tech",
|
|
364
362
|
dexApiUrl: "https://test-dex-api.cloud.aultblockchain.xyz",
|
|
365
363
|
isProduction: false
|
|
366
364
|
},
|
|
@@ -429,15 +427,6 @@ var GAS_CONSTANTS = {
|
|
|
429
427
|
DENOM: "aault",
|
|
430
428
|
/** Chain multiplier applied to min gas to derive max gas (120 = 1.2×). */
|
|
431
429
|
FEE_FREE_GAS_MULTIPLIER: 120,
|
|
432
|
-
/**
|
|
433
|
-
* EIP-712 ante overhead, in gas. The chain's per-message MinGasLimit values
|
|
434
|
-
* (mirrored below) measure the *handler* cost only; a fee-free EIP-712 tx
|
|
435
|
-
* additionally burns ante gas (sig verification + typed-data decode + tx
|
|
436
|
-
* size) that counts against gasWanted. For small-base ops (cancel) the 1.2×
|
|
437
|
-
* buffer doesn't cover it, so the high-level (EIP-712) path adds this on top.
|
|
438
|
-
* The agent path is capped at MinGasLimit×1.2 and must not add it.
|
|
439
|
-
*/
|
|
440
|
-
EIP712_ANTE_GAS: 3e4,
|
|
441
430
|
// License module
|
|
442
431
|
PER_LICENSE: 2e5,
|
|
443
432
|
PER_KYC_MEMBER: 2e5,
|
|
@@ -23448,24 +23437,16 @@ function scaleOrderGas(gas, subOrderCount) {
|
|
|
23448
23437
|
gas.FEE_FREE_GAS_MULTIPLIER
|
|
23449
23438
|
);
|
|
23450
23439
|
}
|
|
23451
|
-
function cancelOrdersGas(gas, orderCount
|
|
23452
|
-
|
|
23440
|
+
function cancelOrdersGas(gas, orderCount) {
|
|
23441
|
+
return computeFeeFreeGasCompound(
|
|
23453
23442
|
gas.CANCEL_ORDER_BASE,
|
|
23454
23443
|
gas.CANCEL_ORDER_PER_ID,
|
|
23455
23444
|
orderCount,
|
|
23456
23445
|
gas.FEE_FREE_GAS_MULTIPLIER
|
|
23457
23446
|
);
|
|
23458
|
-
if (!includeAnte) return feeFree;
|
|
23459
|
-
return (BigInt(feeFree) + BigInt(gas.EIP712_ANTE_GAS)).toString();
|
|
23460
23447
|
}
|
|
23461
|
-
function modifyOrdersGas(gas, orderCount
|
|
23462
|
-
|
|
23463
|
-
gas.MODIFY_ORDER_PER_ID,
|
|
23464
|
-
orderCount,
|
|
23465
|
-
gas.FEE_FREE_GAS_MULTIPLIER
|
|
23466
|
-
);
|
|
23467
|
-
if (!includeAnte) return feeFree;
|
|
23468
|
-
return (BigInt(feeFree) + BigInt(gas.EIP712_ANTE_GAS)).toString();
|
|
23448
|
+
function modifyOrdersGas(gas, orderCount) {
|
|
23449
|
+
return computeFeeFreeGas(gas.MODIFY_ORDER_PER_ID, orderCount, gas.FEE_FREE_GAS_MULTIPLIER);
|
|
23469
23450
|
}
|
|
23470
23451
|
|
|
23471
23452
|
// src/high-level/tx/clob.ts
|
|
@@ -23517,16 +23498,18 @@ function createClobTxApi({ signerAddress, exec, getGas }) {
|
|
|
23517
23498
|
orderIds,
|
|
23518
23499
|
wait,
|
|
23519
23500
|
gasLimit,
|
|
23501
|
+
feeDenom,
|
|
23520
23502
|
feeAmount,
|
|
23521
23503
|
memo,
|
|
23522
23504
|
confirmationTimeoutMs
|
|
23523
23505
|
}) {
|
|
23524
23506
|
const gas = getGas();
|
|
23525
|
-
const cancelGas = gasLimit ?? cancelOrdersGas(gas, orderIds.length
|
|
23507
|
+
const cancelGas = gasLimit ?? cancelOrdersGas(gas, orderIds.length);
|
|
23526
23508
|
return withWaitDecode(
|
|
23527
23509
|
wait,
|
|
23528
23510
|
(w) => exec([buildCancelOrdersMsg(signerAddress, orderIds)], {
|
|
23529
23511
|
gasLimit: cancelGas,
|
|
23512
|
+
feeDenom,
|
|
23530
23513
|
feeAmount,
|
|
23531
23514
|
memo,
|
|
23532
23515
|
confirmationTimeoutMs,
|
|
@@ -23539,6 +23522,7 @@ function createClobTxApi({ signerAddress, exec, getGas }) {
|
|
|
23539
23522
|
orders,
|
|
23540
23523
|
wait,
|
|
23541
23524
|
gasLimit,
|
|
23525
|
+
feeDenom,
|
|
23542
23526
|
feeAmount,
|
|
23543
23527
|
memo,
|
|
23544
23528
|
confirmationTimeoutMs
|
|
@@ -23546,11 +23530,12 @@ function createClobTxApi({ signerAddress, exec, getGas }) {
|
|
|
23546
23530
|
const modifyMsg = buildModifyOrdersMsg(signerAddress, orders);
|
|
23547
23531
|
assertUniformModifyShape(orders);
|
|
23548
23532
|
const gas = getGas();
|
|
23549
|
-
const modifyGas = gasLimit ?? modifyOrdersGas(gas, orders.length
|
|
23533
|
+
const modifyGas = gasLimit ?? modifyOrdersGas(gas, orders.length);
|
|
23550
23534
|
return withWaitDecode(
|
|
23551
23535
|
wait,
|
|
23552
23536
|
(w) => exec([modifyMsg], {
|
|
23553
23537
|
gasLimit: modifyGas,
|
|
23538
|
+
feeDenom,
|
|
23554
23539
|
feeAmount,
|
|
23555
23540
|
memo,
|
|
23556
23541
|
confirmationTimeoutMs,
|
|
@@ -24723,12 +24708,7 @@ function applyNetworkOverrides(network, manifest) {
|
|
|
24723
24708
|
...manifest.eip712?.gasLimit != null ? { eip712GasLimit: manifest.eip712.gasLimit } : {}
|
|
24724
24709
|
};
|
|
24725
24710
|
}
|
|
24726
|
-
var NON_OVERRIDABLE_GAS_KEYS = [
|
|
24727
|
-
"EIP712_FEE_AMOUNT",
|
|
24728
|
-
"EIP712_GAS_LIMIT",
|
|
24729
|
-
"EIP712_ANTE_GAS",
|
|
24730
|
-
"DENOM"
|
|
24731
|
-
];
|
|
24711
|
+
var NON_OVERRIDABLE_GAS_KEYS = ["EIP712_FEE_AMOUNT", "EIP712_GAS_LIMIT", "DENOM"];
|
|
24732
24712
|
var NON_OVERRIDABLE_GAS_KEY_SET = new Set(NON_OVERRIDABLE_GAS_KEYS);
|
|
24733
24713
|
function applyGasOverrides(gas) {
|
|
24734
24714
|
if (!gas) return GAS_CONSTANTS;
|
|
@@ -25108,8 +25088,7 @@ function createAgentClobTxApi({
|
|
|
25108
25088
|
return withWaitDecode(
|
|
25109
25089
|
wait,
|
|
25110
25090
|
(w) => exec([buildCancelOrdersMsg(masterAddress, orderIds)], {
|
|
25111
|
-
|
|
25112
|
-
gasLimit: gasLimit ?? cancelOrdersGas(gas, orderIds.length, false),
|
|
25091
|
+
gasLimit: gasLimit ?? cancelOrdersGas(gas, orderIds.length),
|
|
25113
25092
|
memo,
|
|
25114
25093
|
confirmationTimeoutMs,
|
|
25115
25094
|
timeoutSeconds,
|
|
@@ -25130,8 +25109,7 @@ function createAgentClobTxApi({
|
|
|
25130
25109
|
return withWaitDecode(
|
|
25131
25110
|
wait,
|
|
25132
25111
|
(w) => exec([buildModifyOrdersMsg(masterAddress, orders)], {
|
|
25133
|
-
|
|
25134
|
-
gasLimit: gasLimit ?? modifyOrdersGas(gas, orders.length, false),
|
|
25112
|
+
gasLimit: gasLimit ?? modifyOrdersGas(gas, orders.length),
|
|
25135
25113
|
memo,
|
|
25136
25114
|
confirmationTimeoutMs,
|
|
25137
25115
|
timeoutSeconds,
|
|
@@ -26157,7 +26135,7 @@ function createDexWs(url, options) {
|
|
|
26157
26135
|
}
|
|
26158
26136
|
|
|
26159
26137
|
// src/index.ts
|
|
26160
|
-
var SDK_VERSION = "0.
|
|
26138
|
+
var SDK_VERSION = "0.4.1";
|
|
26161
26139
|
export {
|
|
26162
26140
|
AGENT_DEFAULTS,
|
|
26163
26141
|
AULT_SIGNER_MARKER,
|