ault-sdk-ts 0.0.2-alpha.22 → 0.0.2-alpha.24
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 +32 -7
- package/dist/agent/sign-and-broadcast.d.ts +10 -3
- package/dist/agent/tx/clob.d.ts +1 -1
- package/dist/agent/tx-executor.d.ts +9 -1
- package/dist/client.d.ts +2 -7
- package/dist/core/clob-gas.d.ts +22 -0
- package/dist/core/clob-msgs.d.ts +2 -3
- package/dist/core/clob-responses.d.ts +19 -0
- package/dist/core/errors.d.ts +13 -0
- package/dist/eip712/msg.generated.d.ts +10 -4
- package/dist/eip712/registry.d.ts +2 -0
- package/dist/eip712/sign-and-broadcast.d.ts +19 -4
- package/dist/high-level/tx-executor.d.ts +9 -1
- package/dist/high-level/types.d.ts +152 -64
- package/dist/high-level-client.d.ts +1 -1
- package/dist/index.cjs +1441 -624
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1438 -622
- package/dist/index.js.map +1 -1
- package/dist/proto/gen/ault/accountx/v1/query.d.ts +32 -0
- package/dist/proto/gen/ault/agent/v1/tx.d.ts +4 -5
- package/dist/proto/gen/ault/clob/v1/genesis.d.ts +0 -7
- package/dist/proto/gen/ault/clob/v1/tx.d.ts +25 -3
- package/dist/proto/gen/ault/license/v1/genesis.d.ts +1 -26
- package/dist/proto/gen/ault/license/v1/license.d.ts +0 -14
- package/dist/proto/gen/ault/license/v1/query.d.ts +44 -18
- package/dist/proto/gen/ault/market/v1/market.d.ts +1 -0
- package/dist/proto/gen/ault/market/v1/tx.d.ts +9 -0
- package/dist/proto/gen/ault/miner/v1/genesis.d.ts +52 -84
- package/dist/proto/gen/ault/miner/v1/miner.d.ts +10 -45
- package/dist/proto/gen/ault/miner/v1/query.d.ts +0 -13
- package/dist/proto/gen/ault/spot/v1/genesis.d.ts +2 -2
- package/dist/proto/gen/ault/spot/v1/order.d.ts +12 -4
- package/dist/proto/gen/ault/tokenregistry/v1/genesis.d.ts +3 -3
- package/dist/proto/gen/ault/tokenregistry/v1/query.d.ts +2 -2
- package/dist/proto/gen/ault/tokenregistry/v1/tokenregistry.d.ts +24 -15
- package/dist/proto/gen/ault/tokenregistry/v1/tx.d.ts +1 -1
- package/dist/proto/tx-decode.d.ts +18 -0
- package/dist/rest/dex-types.generated.d.ts +12 -27
- package/dist/rest/dex.generated.d.ts +24 -52
- package/dist/rest/license.d.ts +1 -2
- package/dist/rest/types.d.ts +1 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -98,6 +98,7 @@ __export(index_exports, {
|
|
|
98
98
|
ManifestUrlsSchema: () => ManifestUrlsSchema,
|
|
99
99
|
MarketId: () => MarketId,
|
|
100
100
|
MarketType: () => MarketType,
|
|
101
|
+
MissingMsgResponseError: () => MissingMsgResponseError,
|
|
101
102
|
NETWORKS: () => NETWORKS,
|
|
102
103
|
NetworkError: () => NetworkError,
|
|
103
104
|
OrderId: () => OrderId,
|
|
@@ -438,6 +439,16 @@ var TxConfirmationUnavailableError = class extends TxError {
|
|
|
438
439
|
this.name = "TxConfirmationUnavailableError";
|
|
439
440
|
}
|
|
440
441
|
};
|
|
442
|
+
var MissingMsgResponseError = class extends Error {
|
|
443
|
+
constructor(typeUrl, txHash) {
|
|
444
|
+
super(
|
|
445
|
+
`Transaction committed but the expected msg response ${typeUrl} was missing` + (txHash ? ` (txHash ${txHash}); re-query by hash to recover it.` : ".")
|
|
446
|
+
);
|
|
447
|
+
this.name = "MissingMsgResponseError";
|
|
448
|
+
this.typeUrl = typeUrl;
|
|
449
|
+
this.txHash = txHash;
|
|
450
|
+
}
|
|
451
|
+
};
|
|
441
452
|
function formatTxErrorMessage(params) {
|
|
442
453
|
const head = `Transaction ${params.txHash} failed (code ${params.code})`;
|
|
443
454
|
return params.rawLog ? `${head}: ${params.rawLog}` : `${head}.`;
|
|
@@ -5099,62 +5110,6 @@ var QueryIsKYCApproverResponse = {
|
|
|
5099
5110
|
return message;
|
|
5100
5111
|
}
|
|
5101
5112
|
};
|
|
5102
|
-
function createBaseQueryActiveLicenseCountAtResponse() {
|
|
5103
|
-
return { count: 0n };
|
|
5104
|
-
}
|
|
5105
|
-
var QueryActiveLicenseCountAtResponse = {
|
|
5106
|
-
encode(message, writer = new import_wire18.BinaryWriter()) {
|
|
5107
|
-
if (message.count !== 0n) {
|
|
5108
|
-
if (BigInt.asUintN(64, message.count) !== message.count) {
|
|
5109
|
-
throw new globalThis.Error(
|
|
5110
|
-
"value provided for field message.count of type uint64 too large"
|
|
5111
|
-
);
|
|
5112
|
-
}
|
|
5113
|
-
writer.uint32(8).uint64(message.count);
|
|
5114
|
-
}
|
|
5115
|
-
return writer;
|
|
5116
|
-
},
|
|
5117
|
-
decode(input, length) {
|
|
5118
|
-
const reader = input instanceof import_wire18.BinaryReader ? input : new import_wire18.BinaryReader(input);
|
|
5119
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
5120
|
-
const message = createBaseQueryActiveLicenseCountAtResponse();
|
|
5121
|
-
while (reader.pos < end) {
|
|
5122
|
-
const tag = reader.uint32();
|
|
5123
|
-
switch (tag >>> 3) {
|
|
5124
|
-
case 1: {
|
|
5125
|
-
if (tag !== 8) {
|
|
5126
|
-
break;
|
|
5127
|
-
}
|
|
5128
|
-
message.count = reader.uint64();
|
|
5129
|
-
continue;
|
|
5130
|
-
}
|
|
5131
|
-
}
|
|
5132
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
5133
|
-
break;
|
|
5134
|
-
}
|
|
5135
|
-
reader.skip(tag & 7);
|
|
5136
|
-
}
|
|
5137
|
-
return message;
|
|
5138
|
-
},
|
|
5139
|
-
fromJSON(object2) {
|
|
5140
|
-
return { count: isSet17(object2.count) ? BigInt(object2.count) : 0n };
|
|
5141
|
-
},
|
|
5142
|
-
toJSON(message) {
|
|
5143
|
-
const obj = {};
|
|
5144
|
-
if (message.count !== 0n) {
|
|
5145
|
-
obj.count = message.count.toString();
|
|
5146
|
-
}
|
|
5147
|
-
return obj;
|
|
5148
|
-
},
|
|
5149
|
-
create(base) {
|
|
5150
|
-
return QueryActiveLicenseCountAtResponse.fromPartial(base ?? {});
|
|
5151
|
-
},
|
|
5152
|
-
fromPartial(object2) {
|
|
5153
|
-
const message = createBaseQueryActiveLicenseCountAtResponse();
|
|
5154
|
-
message.count = object2.count ?? 0n;
|
|
5155
|
-
return message;
|
|
5156
|
-
}
|
|
5157
|
-
};
|
|
5158
5113
|
function toTimestamp4(date) {
|
|
5159
5114
|
const seconds = BigInt(Math.trunc(date.getTime() / 1e3));
|
|
5160
5115
|
const nanos = date.getTime() % 1e3 * 1e6;
|
|
@@ -5278,14 +5233,6 @@ function createLicenseApi(context) {
|
|
|
5278
5233
|
`/ault/license/v1/is_kyc_approver/${address}`,
|
|
5279
5234
|
QueryIsKYCApproverResponse
|
|
5280
5235
|
);
|
|
5281
|
-
},
|
|
5282
|
-
async getActiveLicenseCountAt(owner, snapshotTime) {
|
|
5283
|
-
const query = buildQuery({ snapshot_time: snapshotTime });
|
|
5284
|
-
return fetchProtoJson(
|
|
5285
|
-
context,
|
|
5286
|
-
`/ault/license/v1/active_license_count_at/${owner}${query}`,
|
|
5287
|
-
QueryActiveLicenseCountAtResponse
|
|
5288
|
-
);
|
|
5289
5236
|
}
|
|
5290
5237
|
};
|
|
5291
5238
|
}
|
|
@@ -5338,7 +5285,8 @@ function createBaseMarketResponse() {
|
|
|
5338
5285
|
tickPrecision: 0,
|
|
5339
5286
|
lastPrice: "",
|
|
5340
5287
|
lastMatchingHeight: 0n,
|
|
5341
|
-
halted: false
|
|
5288
|
+
halted: false,
|
|
5289
|
+
deployer: ""
|
|
5342
5290
|
};
|
|
5343
5291
|
}
|
|
5344
5292
|
var MarketResponse = {
|
|
@@ -5381,6 +5329,9 @@ var MarketResponse = {
|
|
|
5381
5329
|
if (message.halted !== false) {
|
|
5382
5330
|
writer.uint32(88).bool(message.halted);
|
|
5383
5331
|
}
|
|
5332
|
+
if (message.deployer !== "") {
|
|
5333
|
+
writer.uint32(98).string(message.deployer);
|
|
5334
|
+
}
|
|
5384
5335
|
return writer;
|
|
5385
5336
|
},
|
|
5386
5337
|
decode(input, length) {
|
|
@@ -5467,6 +5418,13 @@ var MarketResponse = {
|
|
|
5467
5418
|
message.halted = reader.bool();
|
|
5468
5419
|
continue;
|
|
5469
5420
|
}
|
|
5421
|
+
case 12: {
|
|
5422
|
+
if (tag !== 98) {
|
|
5423
|
+
break;
|
|
5424
|
+
}
|
|
5425
|
+
message.deployer = reader.string();
|
|
5426
|
+
continue;
|
|
5427
|
+
}
|
|
5470
5428
|
}
|
|
5471
5429
|
if ((tag & 7) === 4 || tag === 0) {
|
|
5472
5430
|
break;
|
|
@@ -5487,7 +5445,8 @@ var MarketResponse = {
|
|
|
5487
5445
|
tickPrecision: isSet18(object2.tickPrecision) ? globalThis.Number(object2.tickPrecision) : isSet18(object2.tick_precision) ? globalThis.Number(object2.tick_precision) : 0,
|
|
5488
5446
|
lastPrice: isSet18(object2.lastPrice) ? globalThis.String(object2.lastPrice) : isSet18(object2.last_price) ? globalThis.String(object2.last_price) : "",
|
|
5489
5447
|
lastMatchingHeight: isSet18(object2.lastMatchingHeight) ? BigInt(object2.lastMatchingHeight) : isSet18(object2.last_matching_height) ? BigInt(object2.last_matching_height) : 0n,
|
|
5490
|
-
halted: isSet18(object2.halted) ? globalThis.Boolean(object2.halted) : false
|
|
5448
|
+
halted: isSet18(object2.halted) ? globalThis.Boolean(object2.halted) : false,
|
|
5449
|
+
deployer: isSet18(object2.deployer) ? globalThis.String(object2.deployer) : ""
|
|
5491
5450
|
};
|
|
5492
5451
|
},
|
|
5493
5452
|
toJSON(message) {
|
|
@@ -5525,6 +5484,9 @@ var MarketResponse = {
|
|
|
5525
5484
|
if (message.halted !== false) {
|
|
5526
5485
|
obj.halted = message.halted;
|
|
5527
5486
|
}
|
|
5487
|
+
if (message.deployer !== "") {
|
|
5488
|
+
obj.deployer = message.deployer;
|
|
5489
|
+
}
|
|
5528
5490
|
return obj;
|
|
5529
5491
|
},
|
|
5530
5492
|
create(base) {
|
|
@@ -5543,6 +5505,7 @@ var MarketResponse = {
|
|
|
5543
5505
|
message.lastPrice = object2.lastPrice ?? "";
|
|
5544
5506
|
message.lastMatchingHeight = object2.lastMatchingHeight ?? 0n;
|
|
5545
5507
|
message.halted = object2.halted ?? false;
|
|
5508
|
+
message.deployer = object2.deployer ?? "";
|
|
5546
5509
|
return message;
|
|
5547
5510
|
}
|
|
5548
5511
|
};
|
|
@@ -6093,7 +6056,7 @@ var EpochInfo = {
|
|
|
6093
6056
|
}
|
|
6094
6057
|
};
|
|
6095
6058
|
function createBaseOperatorInfo() {
|
|
6096
|
-
return { operator: "", commissionRate: 0, commissionRecipient: ""
|
|
6059
|
+
return { operator: "", commissionRate: 0, commissionRecipient: "" };
|
|
6097
6060
|
}
|
|
6098
6061
|
var OperatorInfo = {
|
|
6099
6062
|
encode(message, writer = new import_wire22.BinaryWriter()) {
|
|
@@ -6106,14 +6069,6 @@ var OperatorInfo = {
|
|
|
6106
6069
|
if (message.commissionRecipient !== "") {
|
|
6107
6070
|
writer.uint32(26).string(message.commissionRecipient);
|
|
6108
6071
|
}
|
|
6109
|
-
if (message.lastUpdateEpoch !== 0n) {
|
|
6110
|
-
if (BigInt.asUintN(64, message.lastUpdateEpoch) !== message.lastUpdateEpoch) {
|
|
6111
|
-
throw new globalThis.Error(
|
|
6112
|
-
"value provided for field message.lastUpdateEpoch of type uint64 too large"
|
|
6113
|
-
);
|
|
6114
|
-
}
|
|
6115
|
-
writer.uint32(32).uint64(message.lastUpdateEpoch);
|
|
6116
|
-
}
|
|
6117
6072
|
return writer;
|
|
6118
6073
|
},
|
|
6119
6074
|
decode(input, length) {
|
|
@@ -6144,13 +6099,6 @@ var OperatorInfo = {
|
|
|
6144
6099
|
message.commissionRecipient = reader.string();
|
|
6145
6100
|
continue;
|
|
6146
6101
|
}
|
|
6147
|
-
case 4: {
|
|
6148
|
-
if (tag !== 32) {
|
|
6149
|
-
break;
|
|
6150
|
-
}
|
|
6151
|
-
message.lastUpdateEpoch = reader.uint64();
|
|
6152
|
-
continue;
|
|
6153
|
-
}
|
|
6154
6102
|
}
|
|
6155
6103
|
if ((tag & 7) === 4 || tag === 0) {
|
|
6156
6104
|
break;
|
|
@@ -6163,8 +6111,7 @@ var OperatorInfo = {
|
|
|
6163
6111
|
return {
|
|
6164
6112
|
operator: isSet21(object2.operator) ? globalThis.String(object2.operator) : "",
|
|
6165
6113
|
commissionRate: isSet21(object2.commissionRate) ? globalThis.Number(object2.commissionRate) : isSet21(object2.commission_rate) ? globalThis.Number(object2.commission_rate) : 0,
|
|
6166
|
-
commissionRecipient: isSet21(object2.commissionRecipient) ? globalThis.String(object2.commissionRecipient) : isSet21(object2.commission_recipient) ? globalThis.String(object2.commission_recipient) : ""
|
|
6167
|
-
lastUpdateEpoch: isSet21(object2.lastUpdateEpoch) ? BigInt(object2.lastUpdateEpoch) : isSet21(object2.last_update_epoch) ? BigInt(object2.last_update_epoch) : 0n
|
|
6114
|
+
commissionRecipient: isSet21(object2.commissionRecipient) ? globalThis.String(object2.commissionRecipient) : isSet21(object2.commission_recipient) ? globalThis.String(object2.commission_recipient) : ""
|
|
6168
6115
|
};
|
|
6169
6116
|
},
|
|
6170
6117
|
toJSON(message) {
|
|
@@ -6178,9 +6125,6 @@ var OperatorInfo = {
|
|
|
6178
6125
|
if (message.commissionRecipient !== "") {
|
|
6179
6126
|
obj.commissionRecipient = message.commissionRecipient;
|
|
6180
6127
|
}
|
|
6181
|
-
if (message.lastUpdateEpoch !== 0n) {
|
|
6182
|
-
obj.lastUpdateEpoch = message.lastUpdateEpoch.toString();
|
|
6183
|
-
}
|
|
6184
6128
|
return obj;
|
|
6185
6129
|
},
|
|
6186
6130
|
create(base) {
|
|
@@ -6191,7 +6135,6 @@ var OperatorInfo = {
|
|
|
6191
6135
|
message.operator = object2.operator ?? "";
|
|
6192
6136
|
message.commissionRate = object2.commissionRate ?? 0;
|
|
6193
6137
|
message.commissionRecipient = object2.commissionRecipient ?? "";
|
|
6194
|
-
message.lastUpdateEpoch = object2.lastUpdateEpoch ?? 0n;
|
|
6195
6138
|
return message;
|
|
6196
6139
|
}
|
|
6197
6140
|
};
|
|
@@ -6833,49 +6776,16 @@ var QueryEpochResponse = {
|
|
|
6833
6776
|
}
|
|
6834
6777
|
};
|
|
6835
6778
|
function createBaseQueryLicenseMinerInfoResponse() {
|
|
6836
|
-
return {
|
|
6837
|
-
vrfPubkey: new Uint8Array(0),
|
|
6838
|
-
lastSubmitEpoch: 0n,
|
|
6839
|
-
eligibleNow: false,
|
|
6840
|
-
quarantinedLocal: false,
|
|
6841
|
-
quarantinedSource: false,
|
|
6842
|
-
allTimeCredits: 0n,
|
|
6843
|
-
allTimePayouts: ""
|
|
6844
|
-
};
|
|
6779
|
+
return { vrfPubkey: new Uint8Array(0), eligibleNow: false };
|
|
6845
6780
|
}
|
|
6846
6781
|
var QueryLicenseMinerInfoResponse = {
|
|
6847
6782
|
encode(message, writer = new import_wire23.BinaryWriter()) {
|
|
6848
6783
|
if (message.vrfPubkey.length !== 0) {
|
|
6849
6784
|
writer.uint32(10).bytes(message.vrfPubkey);
|
|
6850
6785
|
}
|
|
6851
|
-
if (message.lastSubmitEpoch !== 0n) {
|
|
6852
|
-
if (BigInt.asUintN(64, message.lastSubmitEpoch) !== message.lastSubmitEpoch) {
|
|
6853
|
-
throw new globalThis.Error(
|
|
6854
|
-
"value provided for field message.lastSubmitEpoch of type uint64 too large"
|
|
6855
|
-
);
|
|
6856
|
-
}
|
|
6857
|
-
writer.uint32(16).uint64(message.lastSubmitEpoch);
|
|
6858
|
-
}
|
|
6859
6786
|
if (message.eligibleNow !== false) {
|
|
6860
6787
|
writer.uint32(24).bool(message.eligibleNow);
|
|
6861
6788
|
}
|
|
6862
|
-
if (message.quarantinedLocal !== false) {
|
|
6863
|
-
writer.uint32(32).bool(message.quarantinedLocal);
|
|
6864
|
-
}
|
|
6865
|
-
if (message.quarantinedSource !== false) {
|
|
6866
|
-
writer.uint32(40).bool(message.quarantinedSource);
|
|
6867
|
-
}
|
|
6868
|
-
if (message.allTimeCredits !== 0n) {
|
|
6869
|
-
if (BigInt.asUintN(64, message.allTimeCredits) !== message.allTimeCredits) {
|
|
6870
|
-
throw new globalThis.Error(
|
|
6871
|
-
"value provided for field message.allTimeCredits of type uint64 too large"
|
|
6872
|
-
);
|
|
6873
|
-
}
|
|
6874
|
-
writer.uint32(48).uint64(message.allTimeCredits);
|
|
6875
|
-
}
|
|
6876
|
-
if (message.allTimePayouts !== "") {
|
|
6877
|
-
writer.uint32(58).string(message.allTimePayouts);
|
|
6878
|
-
}
|
|
6879
6789
|
return writer;
|
|
6880
6790
|
},
|
|
6881
6791
|
decode(input, length) {
|
|
@@ -6892,13 +6802,6 @@ var QueryLicenseMinerInfoResponse = {
|
|
|
6892
6802
|
message.vrfPubkey = reader.bytes();
|
|
6893
6803
|
continue;
|
|
6894
6804
|
}
|
|
6895
|
-
case 2: {
|
|
6896
|
-
if (tag !== 16) {
|
|
6897
|
-
break;
|
|
6898
|
-
}
|
|
6899
|
-
message.lastSubmitEpoch = reader.uint64();
|
|
6900
|
-
continue;
|
|
6901
|
-
}
|
|
6902
6805
|
case 3: {
|
|
6903
6806
|
if (tag !== 24) {
|
|
6904
6807
|
break;
|
|
@@ -6906,34 +6809,6 @@ var QueryLicenseMinerInfoResponse = {
|
|
|
6906
6809
|
message.eligibleNow = reader.bool();
|
|
6907
6810
|
continue;
|
|
6908
6811
|
}
|
|
6909
|
-
case 4: {
|
|
6910
|
-
if (tag !== 32) {
|
|
6911
|
-
break;
|
|
6912
|
-
}
|
|
6913
|
-
message.quarantinedLocal = reader.bool();
|
|
6914
|
-
continue;
|
|
6915
|
-
}
|
|
6916
|
-
case 5: {
|
|
6917
|
-
if (tag !== 40) {
|
|
6918
|
-
break;
|
|
6919
|
-
}
|
|
6920
|
-
message.quarantinedSource = reader.bool();
|
|
6921
|
-
continue;
|
|
6922
|
-
}
|
|
6923
|
-
case 6: {
|
|
6924
|
-
if (tag !== 48) {
|
|
6925
|
-
break;
|
|
6926
|
-
}
|
|
6927
|
-
message.allTimeCredits = reader.uint64();
|
|
6928
|
-
continue;
|
|
6929
|
-
}
|
|
6930
|
-
case 7: {
|
|
6931
|
-
if (tag !== 58) {
|
|
6932
|
-
break;
|
|
6933
|
-
}
|
|
6934
|
-
message.allTimePayouts = reader.string();
|
|
6935
|
-
continue;
|
|
6936
|
-
}
|
|
6937
6812
|
}
|
|
6938
6813
|
if ((tag & 7) === 4 || tag === 0) {
|
|
6939
6814
|
break;
|
|
@@ -6945,12 +6820,7 @@ var QueryLicenseMinerInfoResponse = {
|
|
|
6945
6820
|
fromJSON(object2) {
|
|
6946
6821
|
return {
|
|
6947
6822
|
vrfPubkey: isSet22(object2.vrfPubkey) ? bytesFromBase647(object2.vrfPubkey) : isSet22(object2.vrf_pubkey) ? bytesFromBase647(object2.vrf_pubkey) : new Uint8Array(0),
|
|
6948
|
-
|
|
6949
|
-
eligibleNow: isSet22(object2.eligibleNow) ? globalThis.Boolean(object2.eligibleNow) : isSet22(object2.eligible_now) ? globalThis.Boolean(object2.eligible_now) : false,
|
|
6950
|
-
quarantinedLocal: isSet22(object2.quarantinedLocal) ? globalThis.Boolean(object2.quarantinedLocal) : isSet22(object2.quarantined_local) ? globalThis.Boolean(object2.quarantined_local) : false,
|
|
6951
|
-
quarantinedSource: isSet22(object2.quarantinedSource) ? globalThis.Boolean(object2.quarantinedSource) : isSet22(object2.quarantined_source) ? globalThis.Boolean(object2.quarantined_source) : false,
|
|
6952
|
-
allTimeCredits: isSet22(object2.allTimeCredits) ? BigInt(object2.allTimeCredits) : isSet22(object2.all_time_credits) ? BigInt(object2.all_time_credits) : 0n,
|
|
6953
|
-
allTimePayouts: isSet22(object2.allTimePayouts) ? globalThis.String(object2.allTimePayouts) : isSet22(object2.all_time_payouts) ? globalThis.String(object2.all_time_payouts) : ""
|
|
6823
|
+
eligibleNow: isSet22(object2.eligibleNow) ? globalThis.Boolean(object2.eligibleNow) : isSet22(object2.eligible_now) ? globalThis.Boolean(object2.eligible_now) : false
|
|
6954
6824
|
};
|
|
6955
6825
|
},
|
|
6956
6826
|
toJSON(message) {
|
|
@@ -6958,24 +6828,9 @@ var QueryLicenseMinerInfoResponse = {
|
|
|
6958
6828
|
if (message.vrfPubkey.length !== 0) {
|
|
6959
6829
|
obj.vrfPubkey = base64FromBytes7(message.vrfPubkey);
|
|
6960
6830
|
}
|
|
6961
|
-
if (message.lastSubmitEpoch !== 0n) {
|
|
6962
|
-
obj.lastSubmitEpoch = message.lastSubmitEpoch.toString();
|
|
6963
|
-
}
|
|
6964
6831
|
if (message.eligibleNow !== false) {
|
|
6965
6832
|
obj.eligibleNow = message.eligibleNow;
|
|
6966
6833
|
}
|
|
6967
|
-
if (message.quarantinedLocal !== false) {
|
|
6968
|
-
obj.quarantinedLocal = message.quarantinedLocal;
|
|
6969
|
-
}
|
|
6970
|
-
if (message.quarantinedSource !== false) {
|
|
6971
|
-
obj.quarantinedSource = message.quarantinedSource;
|
|
6972
|
-
}
|
|
6973
|
-
if (message.allTimeCredits !== 0n) {
|
|
6974
|
-
obj.allTimeCredits = message.allTimeCredits.toString();
|
|
6975
|
-
}
|
|
6976
|
-
if (message.allTimePayouts !== "") {
|
|
6977
|
-
obj.allTimePayouts = message.allTimePayouts;
|
|
6978
|
-
}
|
|
6979
6834
|
return obj;
|
|
6980
6835
|
},
|
|
6981
6836
|
create(base) {
|
|
@@ -6984,12 +6839,7 @@ var QueryLicenseMinerInfoResponse = {
|
|
|
6984
6839
|
fromPartial(object2) {
|
|
6985
6840
|
const message = createBaseQueryLicenseMinerInfoResponse();
|
|
6986
6841
|
message.vrfPubkey = object2.vrfPubkey ?? new Uint8Array(0);
|
|
6987
|
-
message.lastSubmitEpoch = object2.lastSubmitEpoch ?? 0n;
|
|
6988
6842
|
message.eligibleNow = object2.eligibleNow ?? false;
|
|
6989
|
-
message.quarantinedLocal = object2.quarantinedLocal ?? false;
|
|
6990
|
-
message.quarantinedSource = object2.quarantinedSource ?? false;
|
|
6991
|
-
message.allTimeCredits = object2.allTimeCredits ?? 0n;
|
|
6992
|
-
message.allTimePayouts = object2.allTimePayouts ?? "";
|
|
6993
6843
|
return message;
|
|
6994
6844
|
}
|
|
6995
6845
|
};
|
|
@@ -12111,74 +11961,6 @@ var Limiter = {
|
|
|
12111
11961
|
return message;
|
|
12112
11962
|
}
|
|
12113
11963
|
};
|
|
12114
|
-
function createBaseTransferLimitConfig() {
|
|
12115
|
-
return { hourly: void 0, daily: void 0 };
|
|
12116
|
-
}
|
|
12117
|
-
var TransferLimitConfig = {
|
|
12118
|
-
encode(message, writer = new import_wire32.BinaryWriter()) {
|
|
12119
|
-
if (message.hourly !== void 0) {
|
|
12120
|
-
Limiter.encode(message.hourly, writer.uint32(10).fork()).join();
|
|
12121
|
-
}
|
|
12122
|
-
if (message.daily !== void 0) {
|
|
12123
|
-
Limiter.encode(message.daily, writer.uint32(18).fork()).join();
|
|
12124
|
-
}
|
|
12125
|
-
return writer;
|
|
12126
|
-
},
|
|
12127
|
-
decode(input, length) {
|
|
12128
|
-
const reader = input instanceof import_wire32.BinaryReader ? input : new import_wire32.BinaryReader(input);
|
|
12129
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
12130
|
-
const message = createBaseTransferLimitConfig();
|
|
12131
|
-
while (reader.pos < end) {
|
|
12132
|
-
const tag = reader.uint32();
|
|
12133
|
-
switch (tag >>> 3) {
|
|
12134
|
-
case 1: {
|
|
12135
|
-
if (tag !== 10) {
|
|
12136
|
-
break;
|
|
12137
|
-
}
|
|
12138
|
-
message.hourly = Limiter.decode(reader, reader.uint32());
|
|
12139
|
-
continue;
|
|
12140
|
-
}
|
|
12141
|
-
case 2: {
|
|
12142
|
-
if (tag !== 18) {
|
|
12143
|
-
break;
|
|
12144
|
-
}
|
|
12145
|
-
message.daily = Limiter.decode(reader, reader.uint32());
|
|
12146
|
-
continue;
|
|
12147
|
-
}
|
|
12148
|
-
}
|
|
12149
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
12150
|
-
break;
|
|
12151
|
-
}
|
|
12152
|
-
reader.skip(tag & 7);
|
|
12153
|
-
}
|
|
12154
|
-
return message;
|
|
12155
|
-
},
|
|
12156
|
-
fromJSON(object2) {
|
|
12157
|
-
return {
|
|
12158
|
-
hourly: isSet30(object2.hourly) ? Limiter.fromJSON(object2.hourly) : void 0,
|
|
12159
|
-
daily: isSet30(object2.daily) ? Limiter.fromJSON(object2.daily) : void 0
|
|
12160
|
-
};
|
|
12161
|
-
},
|
|
12162
|
-
toJSON(message) {
|
|
12163
|
-
const obj = {};
|
|
12164
|
-
if (message.hourly !== void 0) {
|
|
12165
|
-
obj.hourly = Limiter.toJSON(message.hourly);
|
|
12166
|
-
}
|
|
12167
|
-
if (message.daily !== void 0) {
|
|
12168
|
-
obj.daily = Limiter.toJSON(message.daily);
|
|
12169
|
-
}
|
|
12170
|
-
return obj;
|
|
12171
|
-
},
|
|
12172
|
-
create(base) {
|
|
12173
|
-
return TransferLimitConfig.fromPartial(base ?? {});
|
|
12174
|
-
},
|
|
12175
|
-
fromPartial(object2) {
|
|
12176
|
-
const message = createBaseTransferLimitConfig();
|
|
12177
|
-
message.hourly = object2.hourly !== void 0 && object2.hourly !== null ? Limiter.fromPartial(object2.hourly) : void 0;
|
|
12178
|
-
message.daily = object2.daily !== void 0 && object2.daily !== null ? Limiter.fromPartial(object2.daily) : void 0;
|
|
12179
|
-
return message;
|
|
12180
|
-
}
|
|
12181
|
-
};
|
|
12182
11964
|
function createBaseTokenPair() {
|
|
12183
11965
|
return { erc20Address: "", denom: "", erc20Decimals: 0, enabled: false };
|
|
12184
11966
|
}
|
|
@@ -12277,28 +12059,38 @@ var TokenPair = {
|
|
|
12277
12059
|
return message;
|
|
12278
12060
|
}
|
|
12279
12061
|
};
|
|
12280
|
-
function
|
|
12281
|
-
return {
|
|
12062
|
+
function createBaseTransferLimitConfig() {
|
|
12063
|
+
return { hourly: void 0, daily: void 0 };
|
|
12282
12064
|
}
|
|
12283
|
-
var
|
|
12065
|
+
var TransferLimitConfig = {
|
|
12284
12066
|
encode(message, writer = new import_wire32.BinaryWriter()) {
|
|
12285
|
-
if (message.
|
|
12286
|
-
writer.uint32(
|
|
12067
|
+
if (message.hourly !== void 0) {
|
|
12068
|
+
Limiter.encode(message.hourly, writer.uint32(10).fork()).join();
|
|
12069
|
+
}
|
|
12070
|
+
if (message.daily !== void 0) {
|
|
12071
|
+
Limiter.encode(message.daily, writer.uint32(18).fork()).join();
|
|
12287
12072
|
}
|
|
12288
12073
|
return writer;
|
|
12289
12074
|
},
|
|
12290
12075
|
decode(input, length) {
|
|
12291
12076
|
const reader = input instanceof import_wire32.BinaryReader ? input : new import_wire32.BinaryReader(input);
|
|
12292
12077
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
12293
|
-
const message =
|
|
12078
|
+
const message = createBaseTransferLimitConfig();
|
|
12294
12079
|
while (reader.pos < end) {
|
|
12295
12080
|
const tag = reader.uint32();
|
|
12296
12081
|
switch (tag >>> 3) {
|
|
12297
12082
|
case 1: {
|
|
12298
|
-
if (tag !==
|
|
12083
|
+
if (tag !== 10) {
|
|
12299
12084
|
break;
|
|
12300
12085
|
}
|
|
12301
|
-
message.
|
|
12086
|
+
message.hourly = Limiter.decode(reader, reader.uint32());
|
|
12087
|
+
continue;
|
|
12088
|
+
}
|
|
12089
|
+
case 2: {
|
|
12090
|
+
if (tag !== 18) {
|
|
12091
|
+
break;
|
|
12092
|
+
}
|
|
12093
|
+
message.daily = Limiter.decode(reader, reader.uint32());
|
|
12302
12094
|
continue;
|
|
12303
12095
|
}
|
|
12304
12096
|
}
|
|
@@ -12310,43 +12102,101 @@ var Params12 = {
|
|
|
12310
12102
|
return message;
|
|
12311
12103
|
},
|
|
12312
12104
|
fromJSON(object2) {
|
|
12313
|
-
return {
|
|
12105
|
+
return {
|
|
12106
|
+
hourly: isSet30(object2.hourly) ? Limiter.fromJSON(object2.hourly) : void 0,
|
|
12107
|
+
daily: isSet30(object2.daily) ? Limiter.fromJSON(object2.daily) : void 0
|
|
12108
|
+
};
|
|
12314
12109
|
},
|
|
12315
12110
|
toJSON(message) {
|
|
12316
12111
|
const obj = {};
|
|
12317
|
-
if (message.
|
|
12318
|
-
obj.
|
|
12112
|
+
if (message.hourly !== void 0) {
|
|
12113
|
+
obj.hourly = Limiter.toJSON(message.hourly);
|
|
12114
|
+
}
|
|
12115
|
+
if (message.daily !== void 0) {
|
|
12116
|
+
obj.daily = Limiter.toJSON(message.daily);
|
|
12319
12117
|
}
|
|
12320
12118
|
return obj;
|
|
12321
12119
|
},
|
|
12322
12120
|
create(base) {
|
|
12323
|
-
return
|
|
12121
|
+
return TransferLimitConfig.fromPartial(base ?? {});
|
|
12324
12122
|
},
|
|
12325
12123
|
fromPartial(object2) {
|
|
12326
|
-
const message =
|
|
12327
|
-
message.
|
|
12124
|
+
const message = createBaseTransferLimitConfig();
|
|
12125
|
+
message.hourly = object2.hourly !== void 0 && object2.hourly !== null ? Limiter.fromPartial(object2.hourly) : void 0;
|
|
12126
|
+
message.daily = object2.daily !== void 0 && object2.daily !== null ? Limiter.fromPartial(object2.daily) : void 0;
|
|
12328
12127
|
return message;
|
|
12329
12128
|
}
|
|
12330
12129
|
};
|
|
12331
|
-
function
|
|
12332
|
-
return
|
|
12333
|
-
}
|
|
12334
|
-
|
|
12335
|
-
// src/proto/gen/ault/tokenregistry/v1/query.ts
|
|
12336
|
-
function createBaseQueryTokenPairResponse() {
|
|
12337
|
-
return { tokenPair: void 0 };
|
|
12130
|
+
function createBaseParams10() {
|
|
12131
|
+
return { enabled: false };
|
|
12338
12132
|
}
|
|
12339
|
-
var
|
|
12340
|
-
encode(message, writer = new
|
|
12341
|
-
if (message.
|
|
12342
|
-
|
|
12133
|
+
var Params12 = {
|
|
12134
|
+
encode(message, writer = new import_wire32.BinaryWriter()) {
|
|
12135
|
+
if (message.enabled !== false) {
|
|
12136
|
+
writer.uint32(8).bool(message.enabled);
|
|
12343
12137
|
}
|
|
12344
12138
|
return writer;
|
|
12345
12139
|
},
|
|
12346
12140
|
decode(input, length) {
|
|
12347
|
-
const reader = input instanceof
|
|
12141
|
+
const reader = input instanceof import_wire32.BinaryReader ? input : new import_wire32.BinaryReader(input);
|
|
12348
12142
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
12349
|
-
const message =
|
|
12143
|
+
const message = createBaseParams10();
|
|
12144
|
+
while (reader.pos < end) {
|
|
12145
|
+
const tag = reader.uint32();
|
|
12146
|
+
switch (tag >>> 3) {
|
|
12147
|
+
case 1: {
|
|
12148
|
+
if (tag !== 8) {
|
|
12149
|
+
break;
|
|
12150
|
+
}
|
|
12151
|
+
message.enabled = reader.bool();
|
|
12152
|
+
continue;
|
|
12153
|
+
}
|
|
12154
|
+
}
|
|
12155
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12156
|
+
break;
|
|
12157
|
+
}
|
|
12158
|
+
reader.skip(tag & 7);
|
|
12159
|
+
}
|
|
12160
|
+
return message;
|
|
12161
|
+
},
|
|
12162
|
+
fromJSON(object2) {
|
|
12163
|
+
return { enabled: isSet30(object2.enabled) ? globalThis.Boolean(object2.enabled) : false };
|
|
12164
|
+
},
|
|
12165
|
+
toJSON(message) {
|
|
12166
|
+
const obj = {};
|
|
12167
|
+
if (message.enabled !== false) {
|
|
12168
|
+
obj.enabled = message.enabled;
|
|
12169
|
+
}
|
|
12170
|
+
return obj;
|
|
12171
|
+
},
|
|
12172
|
+
create(base) {
|
|
12173
|
+
return Params12.fromPartial(base ?? {});
|
|
12174
|
+
},
|
|
12175
|
+
fromPartial(object2) {
|
|
12176
|
+
const message = createBaseParams10();
|
|
12177
|
+
message.enabled = object2.enabled ?? false;
|
|
12178
|
+
return message;
|
|
12179
|
+
}
|
|
12180
|
+
};
|
|
12181
|
+
function isSet30(value) {
|
|
12182
|
+
return value !== null && value !== void 0;
|
|
12183
|
+
}
|
|
12184
|
+
|
|
12185
|
+
// src/proto/gen/ault/tokenregistry/v1/query.ts
|
|
12186
|
+
function createBaseQueryTokenPairResponse() {
|
|
12187
|
+
return { tokenPair: void 0 };
|
|
12188
|
+
}
|
|
12189
|
+
var QueryTokenPairResponse = {
|
|
12190
|
+
encode(message, writer = new import_wire33.BinaryWriter()) {
|
|
12191
|
+
if (message.tokenPair !== void 0) {
|
|
12192
|
+
TokenPair.encode(message.tokenPair, writer.uint32(10).fork()).join();
|
|
12193
|
+
}
|
|
12194
|
+
return writer;
|
|
12195
|
+
},
|
|
12196
|
+
decode(input, length) {
|
|
12197
|
+
const reader = input instanceof import_wire33.BinaryReader ? input : new import_wire33.BinaryReader(input);
|
|
12198
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
12199
|
+
const message = createBaseQueryTokenPairResponse();
|
|
12350
12200
|
while (reader.pos < end) {
|
|
12351
12201
|
const tag = reader.uint32();
|
|
12352
12202
|
switch (tag >>> 3) {
|
|
@@ -12576,7 +12426,7 @@ var EIP712_MSG_TYPES = {
|
|
|
12576
12426
|
valueFields: [
|
|
12577
12427
|
{ name: "name", type: "string" },
|
|
12578
12428
|
{ name: "master_address", type: "string", jsName: "masterAddress" },
|
|
12579
|
-
{ name: "
|
|
12429
|
+
{ name: "expires_at", type: "string", jsName: "expiresAt" },
|
|
12580
12430
|
{ name: "agent_pubkey", type: "NESTED", jsName: "agentPubkey" }
|
|
12581
12431
|
],
|
|
12582
12432
|
nestedTypes: {
|
|
@@ -12586,8 +12436,8 @@ var EIP712_MSG_TYPES = {
|
|
|
12586
12436
|
],
|
|
12587
12437
|
value: [{ name: "key", type: "string" }]
|
|
12588
12438
|
},
|
|
12589
|
-
|
|
12590
|
-
optionalFields: ["
|
|
12439
|
+
timestampFields: ["expires_at"],
|
|
12440
|
+
optionalFields: ["expires_at"],
|
|
12591
12441
|
fieldSemantics: {
|
|
12592
12442
|
agent_pubkey: { isPubKey: true },
|
|
12593
12443
|
master_address: { isAddress: true }
|
|
@@ -12684,6 +12534,26 @@ var EIP712_MSG_TYPES = {
|
|
|
12684
12534
|
order_ids: { isBinary: true }
|
|
12685
12535
|
}
|
|
12686
12536
|
},
|
|
12537
|
+
"/ault.clob.v1.MsgModifyOrders": {
|
|
12538
|
+
aminoType: "clob/MsgModifyOrders",
|
|
12539
|
+
eip712TypeName: "TypeMsgModifyOrders",
|
|
12540
|
+
valueFields: [
|
|
12541
|
+
{ name: "sender", type: "string" },
|
|
12542
|
+
{ name: "orders", type: "NESTED[]" }
|
|
12543
|
+
],
|
|
12544
|
+
nestedTypes: {
|
|
12545
|
+
orders: [
|
|
12546
|
+
{ name: "order_id", type: "string", jsName: "orderId" },
|
|
12547
|
+
{ name: "new_quantity", type: "string", jsName: "newQuantity" },
|
|
12548
|
+
{ name: "new_price", type: "string", jsName: "newPrice" }
|
|
12549
|
+
]
|
|
12550
|
+
},
|
|
12551
|
+
fieldSemantics: {
|
|
12552
|
+
new_price: { isLegacyDec: true },
|
|
12553
|
+
new_quantity: { isLegacyDec: true },
|
|
12554
|
+
order_id: { isBinary: true }
|
|
12555
|
+
}
|
|
12556
|
+
},
|
|
12687
12557
|
"/ault.clob.v1.MsgPlaceLimitOrder": {
|
|
12688
12558
|
aminoType: "clob/MsgPlaceLimitOrder",
|
|
12689
12559
|
eip712TypeName: "TypeMsgPlaceLimitOrder",
|
|
@@ -12693,12 +12563,12 @@ var EIP712_MSG_TYPES = {
|
|
|
12693
12563
|
{ name: "price", type: "string" },
|
|
12694
12564
|
{ name: "post_only", type: "bool", jsName: "postOnly" },
|
|
12695
12565
|
{ name: "market_id", type: "string", jsName: "marketId" },
|
|
12696
|
-
{ name: "lifespan", type: "string" },
|
|
12697
12566
|
{ name: "is_buy", type: "bool", jsName: "isBuy" },
|
|
12567
|
+
{ name: "deadline", type: "string" },
|
|
12698
12568
|
{ name: "builder_fee_rate", type: "string", jsName: "builderFeeRate" },
|
|
12699
12569
|
{ name: "builder_address", type: "string", jsName: "builderAddress" }
|
|
12700
12570
|
],
|
|
12701
|
-
|
|
12571
|
+
timestampFields: ["deadline"],
|
|
12702
12572
|
optionalFields: ["builder_address", "builder_fee_rate"],
|
|
12703
12573
|
fieldSemantics: {
|
|
12704
12574
|
builder_address: { isAddress: true },
|
|
@@ -12741,13 +12611,13 @@ var EIP712_MSG_TYPES = {
|
|
|
12741
12611
|
{ name: "post_only", type: "bool", jsName: "postOnly" },
|
|
12742
12612
|
{ name: "market_id", type: "string", jsName: "marketId" },
|
|
12743
12613
|
{ name: "low_price", type: "string", jsName: "lowPrice" },
|
|
12744
|
-
{ name: "lifespan", type: "string" },
|
|
12745
12614
|
{ name: "is_buy", type: "bool", jsName: "isBuy" },
|
|
12746
12615
|
{ name: "high_price", type: "string", jsName: "highPrice" },
|
|
12616
|
+
{ name: "deadline", type: "string" },
|
|
12747
12617
|
{ name: "builder_fee_rate", type: "string", jsName: "builderFeeRate" },
|
|
12748
12618
|
{ name: "builder_address", type: "string", jsName: "builderAddress" }
|
|
12749
12619
|
],
|
|
12750
|
-
|
|
12620
|
+
timestampFields: ["deadline"],
|
|
12751
12621
|
optionalFields: ["builder_address", "builder_fee_rate"],
|
|
12752
12622
|
fieldSemantics: {
|
|
12753
12623
|
builder_address: { isAddress: true },
|
|
@@ -12992,9 +12862,11 @@ var EIP712_MSG_TYPES = {
|
|
|
12992
12862
|
eip712TypeName: "TypeMsgCreateMarket",
|
|
12993
12863
|
valueFields: [
|
|
12994
12864
|
{ name: "tick_precision", type: "string", jsName: "tickPrecision", protoHint: "uint32" },
|
|
12865
|
+
{ name: "taker_fee_rate", type: "string", jsName: "takerFeeRate" },
|
|
12995
12866
|
{ name: "sender", type: "string" },
|
|
12996
12867
|
{ name: "quote_denom", type: "string", jsName: "quoteDenom" },
|
|
12997
12868
|
{ name: "market_type", type: "int64", jsName: "marketType" },
|
|
12869
|
+
{ name: "maker_fee_rate", type: "string", jsName: "makerFeeRate" },
|
|
12998
12870
|
{ name: "base_denom", type: "string", jsName: "baseDenom" }
|
|
12999
12871
|
],
|
|
13000
12872
|
enumFieldPaths: {
|
|
@@ -13002,6 +12874,11 @@ var EIP712_MSG_TYPES = {
|
|
|
13002
12874
|
"0": "MARKET_TYPE_UNSPECIFIED",
|
|
13003
12875
|
"1": "MARKET_TYPE_SPOT"
|
|
13004
12876
|
}
|
|
12877
|
+
},
|
|
12878
|
+
optionalFields: ["maker_fee_rate", "taker_fee_rate"],
|
|
12879
|
+
fieldSemantics: {
|
|
12880
|
+
maker_fee_rate: { isLegacyDec: true },
|
|
12881
|
+
taker_fee_rate: { isLegacyDec: true }
|
|
13005
12882
|
}
|
|
13006
12883
|
},
|
|
13007
12884
|
"/ault.market.v1.MsgHaltAllMarkets": {
|
|
@@ -13816,6 +13693,7 @@ var msg = {
|
|
|
13816
13693
|
},
|
|
13817
13694
|
clob: {
|
|
13818
13695
|
cancelOrders: (value) => buildMsg("/ault.clob.v1.MsgCancelOrders", value),
|
|
13696
|
+
modifyOrders: (value) => buildMsg("/ault.clob.v1.MsgModifyOrders", value),
|
|
13819
13697
|
placeLimitOrder: (value) => buildMsg("/ault.clob.v1.MsgPlaceLimitOrder", value),
|
|
13820
13698
|
placeMarketOrder: (value) => buildMsg("/ault.clob.v1.MsgPlaceMarketOrder", value),
|
|
13821
13699
|
placeScaleOrder: (value) => buildMsg("/ault.clob.v1.MsgPlaceScaleOrder", value),
|
|
@@ -14085,6 +13963,51 @@ function durationToNanosecondsString(value, fieldName) {
|
|
|
14085
13963
|
}
|
|
14086
13964
|
return (seconds * 1000000000n + nanos).toString();
|
|
14087
13965
|
}
|
|
13966
|
+
var MAX_RFC3339_SECONDS = 253402300799n;
|
|
13967
|
+
function timestampToRfc3339String(value, fieldName) {
|
|
13968
|
+
let seconds;
|
|
13969
|
+
let nanos;
|
|
13970
|
+
if (value instanceof Date) {
|
|
13971
|
+
const ms = value.getTime();
|
|
13972
|
+
if (Number.isNaN(ms)) {
|
|
13973
|
+
throw new Error(`Timestamp field "${fieldName}" must be a valid Date.`);
|
|
13974
|
+
}
|
|
13975
|
+
const secondsNum = Math.floor(ms / 1e3);
|
|
13976
|
+
seconds = BigInt(secondsNum);
|
|
13977
|
+
nanos = BigInt(ms - secondsNum * 1e3) * 1000000n;
|
|
13978
|
+
} else if (typeof value === "string") {
|
|
13979
|
+
const ms = Date.parse(value);
|
|
13980
|
+
if (Number.isNaN(ms)) {
|
|
13981
|
+
throw new Error(`Timestamp field "${fieldName}" must be a valid RFC 3339 date string.`);
|
|
13982
|
+
}
|
|
13983
|
+
return timestampToRfc3339String(new Date(ms), fieldName);
|
|
13984
|
+
} else if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
13985
|
+
const record2 = value;
|
|
13986
|
+
if (record2.seconds === void 0 && record2.nanos === void 0) {
|
|
13987
|
+
throw new Error(`Timestamp field "${fieldName}" must include seconds or nanos.`);
|
|
13988
|
+
}
|
|
13989
|
+
seconds = toBigIntLike(record2.seconds ?? 0n, `${fieldName}.seconds`);
|
|
13990
|
+
nanos = toBigIntLike(record2.nanos ?? 0, `${fieldName}.nanos`);
|
|
13991
|
+
} else {
|
|
13992
|
+
throw new Error(
|
|
13993
|
+
`Timestamp field "${fieldName}" must be a Date, RFC 3339 string, or protobuf Timestamp object.`
|
|
13994
|
+
);
|
|
13995
|
+
}
|
|
13996
|
+
if (nanos < 0n || nanos > 999999999n) {
|
|
13997
|
+
throw new Error(`Timestamp field "${fieldName}.nanos" must be between 0 and 999999999.`);
|
|
13998
|
+
}
|
|
13999
|
+
if (seconds < 0n || seconds > MAX_RFC3339_SECONDS) {
|
|
14000
|
+
throw new Error(
|
|
14001
|
+
`Timestamp field "${fieldName}.seconds" must be between 1970-01-01 and 9999-12-31.`
|
|
14002
|
+
);
|
|
14003
|
+
}
|
|
14004
|
+
const datePart = new Date(Number(seconds) * 1e3).toISOString().slice(0, 19);
|
|
14005
|
+
if (nanos === 0n) {
|
|
14006
|
+
return `${datePart}Z`;
|
|
14007
|
+
}
|
|
14008
|
+
const fraction = nanos.toString().padStart(9, "0").replace(/0+$/, "");
|
|
14009
|
+
return `${datePart}.${fraction}Z`;
|
|
14010
|
+
}
|
|
14088
14011
|
function normalizeEnumValue(value, fieldPath, enumFieldPaths) {
|
|
14089
14012
|
const values = enumFieldPaths?.[fieldPath];
|
|
14090
14013
|
if (!values) {
|
|
@@ -14110,10 +14033,11 @@ function normalizeEnumValue(value, fieldPath, enumFieldPaths) {
|
|
|
14110
14033
|
}
|
|
14111
14034
|
return value;
|
|
14112
14035
|
}
|
|
14113
|
-
function mapValueToAmino(value, fields, nestedTypes, durationFields, enumFieldPaths, optionalFields, pathPrefix = "", fieldSemantics) {
|
|
14036
|
+
function mapValueToAmino(value, fields, nestedTypes, durationFields, timestampFields, enumFieldPaths, optionalFields, pathPrefix = "", fieldSemantics) {
|
|
14114
14037
|
const record2 = value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
14115
14038
|
const normalized = {};
|
|
14116
14039
|
const durationSet = durationFields ? new Set(durationFields) : void 0;
|
|
14040
|
+
const timestampSet = timestampFields ? new Set(timestampFields) : void 0;
|
|
14117
14041
|
const optionalSet = optionalFields ? new Set(optionalFields) : void 0;
|
|
14118
14042
|
for (const field of fields) {
|
|
14119
14043
|
const jsKey = fieldJsName(field);
|
|
@@ -14146,6 +14070,7 @@ function mapValueToAmino(value, fields, nestedTypes, durationFields, enumFieldPa
|
|
|
14146
14070
|
nestedFields,
|
|
14147
14071
|
nestedTypes,
|
|
14148
14072
|
durationFields,
|
|
14073
|
+
timestampFields,
|
|
14149
14074
|
enumFieldPaths,
|
|
14150
14075
|
optionalFields,
|
|
14151
14076
|
fieldPath,
|
|
@@ -14161,6 +14086,7 @@ function mapValueToAmino(value, fields, nestedTypes, durationFields, enumFieldPa
|
|
|
14161
14086
|
nestedFields,
|
|
14162
14087
|
nestedTypes,
|
|
14163
14088
|
durationFields,
|
|
14089
|
+
timestampFields,
|
|
14164
14090
|
enumFieldPaths,
|
|
14165
14091
|
optionalFields,
|
|
14166
14092
|
fieldPath,
|
|
@@ -14179,6 +14105,16 @@ function mapValueToAmino(value, fields, nestedTypes, durationFields, enumFieldPa
|
|
|
14179
14105
|
normalized[field.name] = durationToNanosecondsString(raw, field.name);
|
|
14180
14106
|
continue;
|
|
14181
14107
|
}
|
|
14108
|
+
if (timestampSet?.has(field.name)) {
|
|
14109
|
+
if (raw === void 0 || raw === null) {
|
|
14110
|
+
if (optionalSet?.has(field.name)) {
|
|
14111
|
+
continue;
|
|
14112
|
+
}
|
|
14113
|
+
throw new Error(`Timestamp field "${field.name}" is required.`);
|
|
14114
|
+
}
|
|
14115
|
+
normalized[field.name] = timestampToRfc3339String(raw, field.name);
|
|
14116
|
+
continue;
|
|
14117
|
+
}
|
|
14182
14118
|
if (raw === void 0) {
|
|
14183
14119
|
continue;
|
|
14184
14120
|
}
|
|
@@ -14323,6 +14259,7 @@ function buildEip712AminoMsg(msg2) {
|
|
|
14323
14259
|
msgConfig.valueFields,
|
|
14324
14260
|
msgConfig.nestedTypes,
|
|
14325
14261
|
msgConfig.durationFields,
|
|
14262
|
+
msgConfig.timestampFields,
|
|
14326
14263
|
msgConfig.enumFieldPaths,
|
|
14327
14264
|
msgConfig.optionalFields,
|
|
14328
14265
|
"",
|
|
@@ -15007,7 +14944,7 @@ function isSet32(value) {
|
|
|
15007
14944
|
// src/proto/gen/ault/agent/v1/tx.ts
|
|
15008
14945
|
var import_wire35 = require("@bufbuild/protobuf/wire");
|
|
15009
14946
|
function createBaseMsgApproveAgent() {
|
|
15010
|
-
return { masterAddress: "", agentPubkey: void 0, name: "",
|
|
14947
|
+
return { masterAddress: "", agentPubkey: void 0, name: "", expiresAt: void 0 };
|
|
15011
14948
|
}
|
|
15012
14949
|
var MsgApproveAgent = {
|
|
15013
14950
|
encode(message, writer = new import_wire35.BinaryWriter()) {
|
|
@@ -15020,8 +14957,8 @@ var MsgApproveAgent = {
|
|
|
15020
14957
|
if (message.name !== "") {
|
|
15021
14958
|
writer.uint32(26).string(message.name);
|
|
15022
14959
|
}
|
|
15023
|
-
if (message.
|
|
15024
|
-
|
|
14960
|
+
if (message.expiresAt !== void 0) {
|
|
14961
|
+
Timestamp.encode(toTimestamp6(message.expiresAt), writer.uint32(34).fork()).join();
|
|
15025
14962
|
}
|
|
15026
14963
|
return writer;
|
|
15027
14964
|
},
|
|
@@ -15057,7 +14994,7 @@ var MsgApproveAgent = {
|
|
|
15057
14994
|
if (tag !== 34) {
|
|
15058
14995
|
break;
|
|
15059
14996
|
}
|
|
15060
|
-
message.
|
|
14997
|
+
message.expiresAt = fromTimestamp6(Timestamp.decode(reader, reader.uint32()));
|
|
15061
14998
|
continue;
|
|
15062
14999
|
}
|
|
15063
15000
|
}
|
|
@@ -15073,7 +15010,7 @@ var MsgApproveAgent = {
|
|
|
15073
15010
|
masterAddress: isSet33(object2.masterAddress) ? globalThis.String(object2.masterAddress) : isSet33(object2.master_address) ? globalThis.String(object2.master_address) : "",
|
|
15074
15011
|
agentPubkey: isSet33(object2.agentPubkey) ? Any.fromJSON(object2.agentPubkey) : isSet33(object2.agent_pubkey) ? Any.fromJSON(object2.agent_pubkey) : void 0,
|
|
15075
15012
|
name: isSet33(object2.name) ? globalThis.String(object2.name) : "",
|
|
15076
|
-
|
|
15013
|
+
expiresAt: isSet33(object2.expiresAt) ? fromJsonTimestamp6(object2.expiresAt) : isSet33(object2.expires_at) ? fromJsonTimestamp6(object2.expires_at) : void 0
|
|
15077
15014
|
};
|
|
15078
15015
|
},
|
|
15079
15016
|
toJSON(message) {
|
|
@@ -15087,8 +15024,8 @@ var MsgApproveAgent = {
|
|
|
15087
15024
|
if (message.name !== "") {
|
|
15088
15025
|
obj.name = message.name;
|
|
15089
15026
|
}
|
|
15090
|
-
if (message.
|
|
15091
|
-
obj.
|
|
15027
|
+
if (message.expiresAt !== void 0) {
|
|
15028
|
+
obj.expiresAt = message.expiresAt.toISOString();
|
|
15092
15029
|
}
|
|
15093
15030
|
return obj;
|
|
15094
15031
|
},
|
|
@@ -15100,7 +15037,7 @@ var MsgApproveAgent = {
|
|
|
15100
15037
|
message.masterAddress = object2.masterAddress ?? "";
|
|
15101
15038
|
message.agentPubkey = object2.agentPubkey !== void 0 && object2.agentPubkey !== null ? Any.fromPartial(object2.agentPubkey) : void 0;
|
|
15102
15039
|
message.name = object2.name ?? "";
|
|
15103
|
-
message.
|
|
15040
|
+
message.expiresAt = object2.expiresAt ?? void 0;
|
|
15104
15041
|
return message;
|
|
15105
15042
|
}
|
|
15106
15043
|
};
|
|
@@ -15240,6 +15177,25 @@ var MsgUpdateParams2 = {
|
|
|
15240
15177
|
return message;
|
|
15241
15178
|
}
|
|
15242
15179
|
};
|
|
15180
|
+
function toTimestamp6(date) {
|
|
15181
|
+
const seconds = BigInt(Math.trunc(date.getTime() / 1e3));
|
|
15182
|
+
const nanos = date.getTime() % 1e3 * 1e6;
|
|
15183
|
+
return { seconds, nanos };
|
|
15184
|
+
}
|
|
15185
|
+
function fromTimestamp6(t) {
|
|
15186
|
+
let millis = (globalThis.Number(t.seconds.toString()) || 0) * 1e3;
|
|
15187
|
+
millis += (t.nanos || 0) / 1e6;
|
|
15188
|
+
return new globalThis.Date(millis);
|
|
15189
|
+
}
|
|
15190
|
+
function fromJsonTimestamp6(o) {
|
|
15191
|
+
if (o instanceof globalThis.Date) {
|
|
15192
|
+
return o;
|
|
15193
|
+
} else if (typeof o === "string") {
|
|
15194
|
+
return new globalThis.Date(o);
|
|
15195
|
+
} else {
|
|
15196
|
+
return fromTimestamp6(Timestamp.fromJSON(o));
|
|
15197
|
+
}
|
|
15198
|
+
}
|
|
15243
15199
|
function isSet33(value) {
|
|
15244
15200
|
return value !== null && value !== void 0;
|
|
15245
15201
|
}
|
|
@@ -15425,7 +15381,7 @@ function createBaseMsgPlaceLimitOrder() {
|
|
|
15425
15381
|
isBuy: false,
|
|
15426
15382
|
price: "",
|
|
15427
15383
|
quantity: "",
|
|
15428
|
-
|
|
15384
|
+
deadline: void 0,
|
|
15429
15385
|
postOnly: false,
|
|
15430
15386
|
builderAddress: "",
|
|
15431
15387
|
builderFeeRate: ""
|
|
@@ -15448,8 +15404,8 @@ var MsgPlaceLimitOrder = {
|
|
|
15448
15404
|
if (message.quantity !== "") {
|
|
15449
15405
|
writer.uint32(42).string(message.quantity);
|
|
15450
15406
|
}
|
|
15451
|
-
if (message.
|
|
15452
|
-
|
|
15407
|
+
if (message.deadline !== void 0) {
|
|
15408
|
+
Timestamp.encode(toTimestamp7(message.deadline), writer.uint32(50).fork()).join();
|
|
15453
15409
|
}
|
|
15454
15410
|
if (message.postOnly !== false) {
|
|
15455
15411
|
writer.uint32(56).bool(message.postOnly);
|
|
@@ -15508,7 +15464,7 @@ var MsgPlaceLimitOrder = {
|
|
|
15508
15464
|
if (tag !== 50) {
|
|
15509
15465
|
break;
|
|
15510
15466
|
}
|
|
15511
|
-
message.
|
|
15467
|
+
message.deadline = fromTimestamp7(Timestamp.decode(reader, reader.uint32()));
|
|
15512
15468
|
continue;
|
|
15513
15469
|
}
|
|
15514
15470
|
case 7: {
|
|
@@ -15547,7 +15503,7 @@ var MsgPlaceLimitOrder = {
|
|
|
15547
15503
|
isBuy: isSet35(object2.isBuy) ? globalThis.Boolean(object2.isBuy) : isSet35(object2.is_buy) ? globalThis.Boolean(object2.is_buy) : false,
|
|
15548
15504
|
price: isSet35(object2.price) ? globalThis.String(object2.price) : "",
|
|
15549
15505
|
quantity: isSet35(object2.quantity) ? globalThis.String(object2.quantity) : "",
|
|
15550
|
-
|
|
15506
|
+
deadline: isSet35(object2.deadline) ? fromJsonTimestamp7(object2.deadline) : void 0,
|
|
15551
15507
|
postOnly: isSet35(object2.postOnly) ? globalThis.Boolean(object2.postOnly) : isSet35(object2.post_only) ? globalThis.Boolean(object2.post_only) : false,
|
|
15552
15508
|
builderAddress: isSet35(object2.builderAddress) ? globalThis.String(object2.builderAddress) : isSet35(object2.builder_address) ? globalThis.String(object2.builder_address) : "",
|
|
15553
15509
|
builderFeeRate: isSet35(object2.builderFeeRate) ? globalThis.String(object2.builderFeeRate) : isSet35(object2.builder_fee_rate) ? globalThis.String(object2.builder_fee_rate) : ""
|
|
@@ -15570,8 +15526,8 @@ var MsgPlaceLimitOrder = {
|
|
|
15570
15526
|
if (message.quantity !== "") {
|
|
15571
15527
|
obj.quantity = message.quantity;
|
|
15572
15528
|
}
|
|
15573
|
-
if (message.
|
|
15574
|
-
obj.
|
|
15529
|
+
if (message.deadline !== void 0) {
|
|
15530
|
+
obj.deadline = message.deadline.toISOString();
|
|
15575
15531
|
}
|
|
15576
15532
|
if (message.postOnly !== false) {
|
|
15577
15533
|
obj.postOnly = message.postOnly;
|
|
@@ -15594,13 +15550,81 @@ var MsgPlaceLimitOrder = {
|
|
|
15594
15550
|
message.isBuy = object2.isBuy ?? false;
|
|
15595
15551
|
message.price = object2.price ?? "";
|
|
15596
15552
|
message.quantity = object2.quantity ?? "";
|
|
15597
|
-
message.
|
|
15553
|
+
message.deadline = object2.deadline ?? void 0;
|
|
15598
15554
|
message.postOnly = object2.postOnly ?? false;
|
|
15599
15555
|
message.builderAddress = object2.builderAddress ?? "";
|
|
15600
15556
|
message.builderFeeRate = object2.builderFeeRate ?? "";
|
|
15601
15557
|
return message;
|
|
15602
15558
|
}
|
|
15603
15559
|
};
|
|
15560
|
+
function createBaseMsgPlaceLimitOrderResponse() {
|
|
15561
|
+
return { orderId: new Uint8Array(0), escrowedAmount: void 0 };
|
|
15562
|
+
}
|
|
15563
|
+
var MsgPlaceLimitOrderResponse = {
|
|
15564
|
+
encode(message, writer = new import_wire37.BinaryWriter()) {
|
|
15565
|
+
if (message.orderId.length !== 0) {
|
|
15566
|
+
writer.uint32(10).bytes(message.orderId);
|
|
15567
|
+
}
|
|
15568
|
+
if (message.escrowedAmount !== void 0) {
|
|
15569
|
+
Coin.encode(message.escrowedAmount, writer.uint32(18).fork()).join();
|
|
15570
|
+
}
|
|
15571
|
+
return writer;
|
|
15572
|
+
},
|
|
15573
|
+
decode(input, length) {
|
|
15574
|
+
const reader = input instanceof import_wire37.BinaryReader ? input : new import_wire37.BinaryReader(input);
|
|
15575
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
15576
|
+
const message = createBaseMsgPlaceLimitOrderResponse();
|
|
15577
|
+
while (reader.pos < end) {
|
|
15578
|
+
const tag = reader.uint32();
|
|
15579
|
+
switch (tag >>> 3) {
|
|
15580
|
+
case 1: {
|
|
15581
|
+
if (tag !== 10) {
|
|
15582
|
+
break;
|
|
15583
|
+
}
|
|
15584
|
+
message.orderId = reader.bytes();
|
|
15585
|
+
continue;
|
|
15586
|
+
}
|
|
15587
|
+
case 2: {
|
|
15588
|
+
if (tag !== 18) {
|
|
15589
|
+
break;
|
|
15590
|
+
}
|
|
15591
|
+
message.escrowedAmount = Coin.decode(reader, reader.uint32());
|
|
15592
|
+
continue;
|
|
15593
|
+
}
|
|
15594
|
+
}
|
|
15595
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
15596
|
+
break;
|
|
15597
|
+
}
|
|
15598
|
+
reader.skip(tag & 7);
|
|
15599
|
+
}
|
|
15600
|
+
return message;
|
|
15601
|
+
},
|
|
15602
|
+
fromJSON(object2) {
|
|
15603
|
+
return {
|
|
15604
|
+
orderId: isSet35(object2.orderId) ? bytesFromBase648(object2.orderId) : isSet35(object2.order_id) ? bytesFromBase648(object2.order_id) : new Uint8Array(0),
|
|
15605
|
+
escrowedAmount: isSet35(object2.escrowedAmount) ? Coin.fromJSON(object2.escrowedAmount) : isSet35(object2.escrowed_amount) ? Coin.fromJSON(object2.escrowed_amount) : void 0
|
|
15606
|
+
};
|
|
15607
|
+
},
|
|
15608
|
+
toJSON(message) {
|
|
15609
|
+
const obj = {};
|
|
15610
|
+
if (message.orderId.length !== 0) {
|
|
15611
|
+
obj.orderId = base64FromBytes8(message.orderId);
|
|
15612
|
+
}
|
|
15613
|
+
if (message.escrowedAmount !== void 0) {
|
|
15614
|
+
obj.escrowedAmount = Coin.toJSON(message.escrowedAmount);
|
|
15615
|
+
}
|
|
15616
|
+
return obj;
|
|
15617
|
+
},
|
|
15618
|
+
create(base) {
|
|
15619
|
+
return MsgPlaceLimitOrderResponse.fromPartial(base ?? {});
|
|
15620
|
+
},
|
|
15621
|
+
fromPartial(object2) {
|
|
15622
|
+
const message = createBaseMsgPlaceLimitOrderResponse();
|
|
15623
|
+
message.orderId = object2.orderId ?? new Uint8Array(0);
|
|
15624
|
+
message.escrowedAmount = object2.escrowedAmount !== void 0 && object2.escrowedAmount !== null ? Coin.fromPartial(object2.escrowedAmount) : void 0;
|
|
15625
|
+
return message;
|
|
15626
|
+
}
|
|
15627
|
+
};
|
|
15604
15628
|
function createBaseMsgPlaceMarketOrder() {
|
|
15605
15629
|
return {
|
|
15606
15630
|
sender: "",
|
|
@@ -15768,6 +15792,74 @@ var MsgPlaceMarketOrder = {
|
|
|
15768
15792
|
return message;
|
|
15769
15793
|
}
|
|
15770
15794
|
};
|
|
15795
|
+
function createBaseMsgPlaceMarketOrderResponse() {
|
|
15796
|
+
return { orderId: new Uint8Array(0), escrowedAmount: void 0 };
|
|
15797
|
+
}
|
|
15798
|
+
var MsgPlaceMarketOrderResponse = {
|
|
15799
|
+
encode(message, writer = new import_wire37.BinaryWriter()) {
|
|
15800
|
+
if (message.orderId.length !== 0) {
|
|
15801
|
+
writer.uint32(10).bytes(message.orderId);
|
|
15802
|
+
}
|
|
15803
|
+
if (message.escrowedAmount !== void 0) {
|
|
15804
|
+
Coin.encode(message.escrowedAmount, writer.uint32(18).fork()).join();
|
|
15805
|
+
}
|
|
15806
|
+
return writer;
|
|
15807
|
+
},
|
|
15808
|
+
decode(input, length) {
|
|
15809
|
+
const reader = input instanceof import_wire37.BinaryReader ? input : new import_wire37.BinaryReader(input);
|
|
15810
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
15811
|
+
const message = createBaseMsgPlaceMarketOrderResponse();
|
|
15812
|
+
while (reader.pos < end) {
|
|
15813
|
+
const tag = reader.uint32();
|
|
15814
|
+
switch (tag >>> 3) {
|
|
15815
|
+
case 1: {
|
|
15816
|
+
if (tag !== 10) {
|
|
15817
|
+
break;
|
|
15818
|
+
}
|
|
15819
|
+
message.orderId = reader.bytes();
|
|
15820
|
+
continue;
|
|
15821
|
+
}
|
|
15822
|
+
case 2: {
|
|
15823
|
+
if (tag !== 18) {
|
|
15824
|
+
break;
|
|
15825
|
+
}
|
|
15826
|
+
message.escrowedAmount = Coin.decode(reader, reader.uint32());
|
|
15827
|
+
continue;
|
|
15828
|
+
}
|
|
15829
|
+
}
|
|
15830
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
15831
|
+
break;
|
|
15832
|
+
}
|
|
15833
|
+
reader.skip(tag & 7);
|
|
15834
|
+
}
|
|
15835
|
+
return message;
|
|
15836
|
+
},
|
|
15837
|
+
fromJSON(object2) {
|
|
15838
|
+
return {
|
|
15839
|
+
orderId: isSet35(object2.orderId) ? bytesFromBase648(object2.orderId) : isSet35(object2.order_id) ? bytesFromBase648(object2.order_id) : new Uint8Array(0),
|
|
15840
|
+
escrowedAmount: isSet35(object2.escrowedAmount) ? Coin.fromJSON(object2.escrowedAmount) : isSet35(object2.escrowed_amount) ? Coin.fromJSON(object2.escrowed_amount) : void 0
|
|
15841
|
+
};
|
|
15842
|
+
},
|
|
15843
|
+
toJSON(message) {
|
|
15844
|
+
const obj = {};
|
|
15845
|
+
if (message.orderId.length !== 0) {
|
|
15846
|
+
obj.orderId = base64FromBytes8(message.orderId);
|
|
15847
|
+
}
|
|
15848
|
+
if (message.escrowedAmount !== void 0) {
|
|
15849
|
+
obj.escrowedAmount = Coin.toJSON(message.escrowedAmount);
|
|
15850
|
+
}
|
|
15851
|
+
return obj;
|
|
15852
|
+
},
|
|
15853
|
+
create(base) {
|
|
15854
|
+
return MsgPlaceMarketOrderResponse.fromPartial(base ?? {});
|
|
15855
|
+
},
|
|
15856
|
+
fromPartial(object2) {
|
|
15857
|
+
const message = createBaseMsgPlaceMarketOrderResponse();
|
|
15858
|
+
message.orderId = object2.orderId ?? new Uint8Array(0);
|
|
15859
|
+
message.escrowedAmount = object2.escrowedAmount !== void 0 && object2.escrowedAmount !== null ? Coin.fromPartial(object2.escrowedAmount) : void 0;
|
|
15860
|
+
return message;
|
|
15861
|
+
}
|
|
15862
|
+
};
|
|
15771
15863
|
function createBaseMsgCancelOrders() {
|
|
15772
15864
|
return { sender: "", orderIds: [] };
|
|
15773
15865
|
}
|
|
@@ -15836,64 +15928,23 @@ var MsgCancelOrders = {
|
|
|
15836
15928
|
return message;
|
|
15837
15929
|
}
|
|
15838
15930
|
};
|
|
15839
|
-
function
|
|
15840
|
-
return {
|
|
15841
|
-
sender: "",
|
|
15842
|
-
marketId: new Uint8Array(0),
|
|
15843
|
-
isBuy: false,
|
|
15844
|
-
lowPrice: "",
|
|
15845
|
-
highPrice: "",
|
|
15846
|
-
totalQuantity: "",
|
|
15847
|
-
weights: [],
|
|
15848
|
-
lifespan: void 0,
|
|
15849
|
-
postOnly: false,
|
|
15850
|
-
builderAddress: "",
|
|
15851
|
-
builderFeeRate: ""
|
|
15852
|
-
};
|
|
15931
|
+
function createBaseMsgCancelOrdersResponse() {
|
|
15932
|
+
return { succeeded: [], failed: [] };
|
|
15853
15933
|
}
|
|
15854
|
-
var
|
|
15934
|
+
var MsgCancelOrdersResponse = {
|
|
15855
15935
|
encode(message, writer = new import_wire37.BinaryWriter()) {
|
|
15856
|
-
|
|
15857
|
-
writer.uint32(10).
|
|
15858
|
-
}
|
|
15859
|
-
if (message.marketId.length !== 0) {
|
|
15860
|
-
writer.uint32(18).bytes(message.marketId);
|
|
15861
|
-
}
|
|
15862
|
-
if (message.isBuy !== false) {
|
|
15863
|
-
writer.uint32(24).bool(message.isBuy);
|
|
15864
|
-
}
|
|
15865
|
-
if (message.lowPrice !== "") {
|
|
15866
|
-
writer.uint32(34).string(message.lowPrice);
|
|
15867
|
-
}
|
|
15868
|
-
if (message.highPrice !== "") {
|
|
15869
|
-
writer.uint32(42).string(message.highPrice);
|
|
15870
|
-
}
|
|
15871
|
-
if (message.totalQuantity !== "") {
|
|
15872
|
-
writer.uint32(50).string(message.totalQuantity);
|
|
15873
|
-
}
|
|
15874
|
-
writer.uint32(58).fork();
|
|
15875
|
-
for (const v of message.weights) {
|
|
15876
|
-
writer.uint32(v);
|
|
15877
|
-
}
|
|
15878
|
-
writer.join();
|
|
15879
|
-
if (message.lifespan !== void 0) {
|
|
15880
|
-
Duration.encode(message.lifespan, writer.uint32(66).fork()).join();
|
|
15881
|
-
}
|
|
15882
|
-
if (message.postOnly !== false) {
|
|
15883
|
-
writer.uint32(72).bool(message.postOnly);
|
|
15884
|
-
}
|
|
15885
|
-
if (message.builderAddress !== "") {
|
|
15886
|
-
writer.uint32(82).string(message.builderAddress);
|
|
15936
|
+
for (const v of message.succeeded) {
|
|
15937
|
+
writer.uint32(10).bytes(v);
|
|
15887
15938
|
}
|
|
15888
|
-
|
|
15889
|
-
writer.uint32(
|
|
15939
|
+
for (const v of message.failed) {
|
|
15940
|
+
writer.uint32(18).bytes(v);
|
|
15890
15941
|
}
|
|
15891
15942
|
return writer;
|
|
15892
15943
|
},
|
|
15893
15944
|
decode(input, length) {
|
|
15894
15945
|
const reader = input instanceof import_wire37.BinaryReader ? input : new import_wire37.BinaryReader(input);
|
|
15895
15946
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
15896
|
-
const message =
|
|
15947
|
+
const message = createBaseMsgCancelOrdersResponse();
|
|
15897
15948
|
while (reader.pos < end) {
|
|
15898
15949
|
const tag = reader.uint32();
|
|
15899
15950
|
switch (tag >>> 3) {
|
|
@@ -15901,17 +15952,277 @@ var MsgPlaceScaleOrder = {
|
|
|
15901
15952
|
if (tag !== 10) {
|
|
15902
15953
|
break;
|
|
15903
15954
|
}
|
|
15904
|
-
message.
|
|
15955
|
+
message.succeeded.push(reader.bytes());
|
|
15905
15956
|
continue;
|
|
15906
15957
|
}
|
|
15907
15958
|
case 2: {
|
|
15908
15959
|
if (tag !== 18) {
|
|
15909
15960
|
break;
|
|
15910
15961
|
}
|
|
15911
|
-
message.
|
|
15962
|
+
message.failed.push(reader.bytes());
|
|
15912
15963
|
continue;
|
|
15913
15964
|
}
|
|
15914
|
-
|
|
15965
|
+
}
|
|
15966
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
15967
|
+
break;
|
|
15968
|
+
}
|
|
15969
|
+
reader.skip(tag & 7);
|
|
15970
|
+
}
|
|
15971
|
+
return message;
|
|
15972
|
+
},
|
|
15973
|
+
fromJSON(object2) {
|
|
15974
|
+
return {
|
|
15975
|
+
succeeded: globalThis.Array.isArray(object2?.succeeded) ? object2.succeeded.map((e) => bytesFromBase648(e)) : [],
|
|
15976
|
+
failed: globalThis.Array.isArray(object2?.failed) ? object2.failed.map((e) => bytesFromBase648(e)) : []
|
|
15977
|
+
};
|
|
15978
|
+
},
|
|
15979
|
+
toJSON(message) {
|
|
15980
|
+
const obj = {};
|
|
15981
|
+
if (message.succeeded?.length) {
|
|
15982
|
+
obj.succeeded = message.succeeded.map((e) => base64FromBytes8(e));
|
|
15983
|
+
}
|
|
15984
|
+
if (message.failed?.length) {
|
|
15985
|
+
obj.failed = message.failed.map((e) => base64FromBytes8(e));
|
|
15986
|
+
}
|
|
15987
|
+
return obj;
|
|
15988
|
+
},
|
|
15989
|
+
create(base) {
|
|
15990
|
+
return MsgCancelOrdersResponse.fromPartial(base ?? {});
|
|
15991
|
+
},
|
|
15992
|
+
fromPartial(object2) {
|
|
15993
|
+
const message = createBaseMsgCancelOrdersResponse();
|
|
15994
|
+
message.succeeded = object2.succeeded?.map((e) => e) || [];
|
|
15995
|
+
message.failed = object2.failed?.map((e) => e) || [];
|
|
15996
|
+
return message;
|
|
15997
|
+
}
|
|
15998
|
+
};
|
|
15999
|
+
function createBaseMsgModifyOrders() {
|
|
16000
|
+
return { sender: "", orders: [] };
|
|
16001
|
+
}
|
|
16002
|
+
var MsgModifyOrders = {
|
|
16003
|
+
encode(message, writer = new import_wire37.BinaryWriter()) {
|
|
16004
|
+
if (message.sender !== "") {
|
|
16005
|
+
writer.uint32(10).string(message.sender);
|
|
16006
|
+
}
|
|
16007
|
+
for (const v of message.orders) {
|
|
16008
|
+
ModifyOrder.encode(v, writer.uint32(18).fork()).join();
|
|
16009
|
+
}
|
|
16010
|
+
return writer;
|
|
16011
|
+
},
|
|
16012
|
+
decode(input, length) {
|
|
16013
|
+
const reader = input instanceof import_wire37.BinaryReader ? input : new import_wire37.BinaryReader(input);
|
|
16014
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
16015
|
+
const message = createBaseMsgModifyOrders();
|
|
16016
|
+
while (reader.pos < end) {
|
|
16017
|
+
const tag = reader.uint32();
|
|
16018
|
+
switch (tag >>> 3) {
|
|
16019
|
+
case 1: {
|
|
16020
|
+
if (tag !== 10) {
|
|
16021
|
+
break;
|
|
16022
|
+
}
|
|
16023
|
+
message.sender = reader.string();
|
|
16024
|
+
continue;
|
|
16025
|
+
}
|
|
16026
|
+
case 2: {
|
|
16027
|
+
if (tag !== 18) {
|
|
16028
|
+
break;
|
|
16029
|
+
}
|
|
16030
|
+
message.orders.push(ModifyOrder.decode(reader, reader.uint32()));
|
|
16031
|
+
continue;
|
|
16032
|
+
}
|
|
16033
|
+
}
|
|
16034
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
16035
|
+
break;
|
|
16036
|
+
}
|
|
16037
|
+
reader.skip(tag & 7);
|
|
16038
|
+
}
|
|
16039
|
+
return message;
|
|
16040
|
+
},
|
|
16041
|
+
fromJSON(object2) {
|
|
16042
|
+
return {
|
|
16043
|
+
sender: isSet35(object2.sender) ? globalThis.String(object2.sender) : "",
|
|
16044
|
+
orders: globalThis.Array.isArray(object2?.orders) ? object2.orders.map((e) => ModifyOrder.fromJSON(e)) : []
|
|
16045
|
+
};
|
|
16046
|
+
},
|
|
16047
|
+
toJSON(message) {
|
|
16048
|
+
const obj = {};
|
|
16049
|
+
if (message.sender !== "") {
|
|
16050
|
+
obj.sender = message.sender;
|
|
16051
|
+
}
|
|
16052
|
+
if (message.orders?.length) {
|
|
16053
|
+
obj.orders = message.orders.map((e) => ModifyOrder.toJSON(e));
|
|
16054
|
+
}
|
|
16055
|
+
return obj;
|
|
16056
|
+
},
|
|
16057
|
+
create(base) {
|
|
16058
|
+
return MsgModifyOrders.fromPartial(base ?? {});
|
|
16059
|
+
},
|
|
16060
|
+
fromPartial(object2) {
|
|
16061
|
+
const message = createBaseMsgModifyOrders();
|
|
16062
|
+
message.sender = object2.sender ?? "";
|
|
16063
|
+
message.orders = object2.orders?.map((e) => ModifyOrder.fromPartial(e)) || [];
|
|
16064
|
+
return message;
|
|
16065
|
+
}
|
|
16066
|
+
};
|
|
16067
|
+
function createBaseModifyOrder() {
|
|
16068
|
+
return { orderId: new Uint8Array(0), newPrice: "", newQuantity: "" };
|
|
16069
|
+
}
|
|
16070
|
+
var ModifyOrder = {
|
|
16071
|
+
encode(message, writer = new import_wire37.BinaryWriter()) {
|
|
16072
|
+
if (message.orderId.length !== 0) {
|
|
16073
|
+
writer.uint32(10).bytes(message.orderId);
|
|
16074
|
+
}
|
|
16075
|
+
if (message.newPrice !== "") {
|
|
16076
|
+
writer.uint32(18).string(message.newPrice);
|
|
16077
|
+
}
|
|
16078
|
+
if (message.newQuantity !== "") {
|
|
16079
|
+
writer.uint32(26).string(message.newQuantity);
|
|
16080
|
+
}
|
|
16081
|
+
return writer;
|
|
16082
|
+
},
|
|
16083
|
+
decode(input, length) {
|
|
16084
|
+
const reader = input instanceof import_wire37.BinaryReader ? input : new import_wire37.BinaryReader(input);
|
|
16085
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
16086
|
+
const message = createBaseModifyOrder();
|
|
16087
|
+
while (reader.pos < end) {
|
|
16088
|
+
const tag = reader.uint32();
|
|
16089
|
+
switch (tag >>> 3) {
|
|
16090
|
+
case 1: {
|
|
16091
|
+
if (tag !== 10) {
|
|
16092
|
+
break;
|
|
16093
|
+
}
|
|
16094
|
+
message.orderId = reader.bytes();
|
|
16095
|
+
continue;
|
|
16096
|
+
}
|
|
16097
|
+
case 2: {
|
|
16098
|
+
if (tag !== 18) {
|
|
16099
|
+
break;
|
|
16100
|
+
}
|
|
16101
|
+
message.newPrice = reader.string();
|
|
16102
|
+
continue;
|
|
16103
|
+
}
|
|
16104
|
+
case 3: {
|
|
16105
|
+
if (tag !== 26) {
|
|
16106
|
+
break;
|
|
16107
|
+
}
|
|
16108
|
+
message.newQuantity = reader.string();
|
|
16109
|
+
continue;
|
|
16110
|
+
}
|
|
16111
|
+
}
|
|
16112
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
16113
|
+
break;
|
|
16114
|
+
}
|
|
16115
|
+
reader.skip(tag & 7);
|
|
16116
|
+
}
|
|
16117
|
+
return message;
|
|
16118
|
+
},
|
|
16119
|
+
fromJSON(object2) {
|
|
16120
|
+
return {
|
|
16121
|
+
orderId: isSet35(object2.orderId) ? bytesFromBase648(object2.orderId) : isSet35(object2.order_id) ? bytesFromBase648(object2.order_id) : new Uint8Array(0),
|
|
16122
|
+
newPrice: isSet35(object2.newPrice) ? globalThis.String(object2.newPrice) : isSet35(object2.new_price) ? globalThis.String(object2.new_price) : "",
|
|
16123
|
+
newQuantity: isSet35(object2.newQuantity) ? globalThis.String(object2.newQuantity) : isSet35(object2.new_quantity) ? globalThis.String(object2.new_quantity) : ""
|
|
16124
|
+
};
|
|
16125
|
+
},
|
|
16126
|
+
toJSON(message) {
|
|
16127
|
+
const obj = {};
|
|
16128
|
+
if (message.orderId.length !== 0) {
|
|
16129
|
+
obj.orderId = base64FromBytes8(message.orderId);
|
|
16130
|
+
}
|
|
16131
|
+
if (message.newPrice !== "") {
|
|
16132
|
+
obj.newPrice = message.newPrice;
|
|
16133
|
+
}
|
|
16134
|
+
if (message.newQuantity !== "") {
|
|
16135
|
+
obj.newQuantity = message.newQuantity;
|
|
16136
|
+
}
|
|
16137
|
+
return obj;
|
|
16138
|
+
},
|
|
16139
|
+
create(base) {
|
|
16140
|
+
return ModifyOrder.fromPartial(base ?? {});
|
|
16141
|
+
},
|
|
16142
|
+
fromPartial(object2) {
|
|
16143
|
+
const message = createBaseModifyOrder();
|
|
16144
|
+
message.orderId = object2.orderId ?? new Uint8Array(0);
|
|
16145
|
+
message.newPrice = object2.newPrice ?? "";
|
|
16146
|
+
message.newQuantity = object2.newQuantity ?? "";
|
|
16147
|
+
return message;
|
|
16148
|
+
}
|
|
16149
|
+
};
|
|
16150
|
+
function createBaseMsgPlaceScaleOrder() {
|
|
16151
|
+
return {
|
|
16152
|
+
sender: "",
|
|
16153
|
+
marketId: new Uint8Array(0),
|
|
16154
|
+
isBuy: false,
|
|
16155
|
+
lowPrice: "",
|
|
16156
|
+
highPrice: "",
|
|
16157
|
+
totalQuantity: "",
|
|
16158
|
+
weights: [],
|
|
16159
|
+
deadline: void 0,
|
|
16160
|
+
postOnly: false,
|
|
16161
|
+
builderAddress: "",
|
|
16162
|
+
builderFeeRate: ""
|
|
16163
|
+
};
|
|
16164
|
+
}
|
|
16165
|
+
var MsgPlaceScaleOrder = {
|
|
16166
|
+
encode(message, writer = new import_wire37.BinaryWriter()) {
|
|
16167
|
+
if (message.sender !== "") {
|
|
16168
|
+
writer.uint32(10).string(message.sender);
|
|
16169
|
+
}
|
|
16170
|
+
if (message.marketId.length !== 0) {
|
|
16171
|
+
writer.uint32(18).bytes(message.marketId);
|
|
16172
|
+
}
|
|
16173
|
+
if (message.isBuy !== false) {
|
|
16174
|
+
writer.uint32(24).bool(message.isBuy);
|
|
16175
|
+
}
|
|
16176
|
+
if (message.lowPrice !== "") {
|
|
16177
|
+
writer.uint32(34).string(message.lowPrice);
|
|
16178
|
+
}
|
|
16179
|
+
if (message.highPrice !== "") {
|
|
16180
|
+
writer.uint32(42).string(message.highPrice);
|
|
16181
|
+
}
|
|
16182
|
+
if (message.totalQuantity !== "") {
|
|
16183
|
+
writer.uint32(50).string(message.totalQuantity);
|
|
16184
|
+
}
|
|
16185
|
+
writer.uint32(58).fork();
|
|
16186
|
+
for (const v of message.weights) {
|
|
16187
|
+
writer.uint32(v);
|
|
16188
|
+
}
|
|
16189
|
+
writer.join();
|
|
16190
|
+
if (message.deadline !== void 0) {
|
|
16191
|
+
Timestamp.encode(toTimestamp7(message.deadline), writer.uint32(66).fork()).join();
|
|
16192
|
+
}
|
|
16193
|
+
if (message.postOnly !== false) {
|
|
16194
|
+
writer.uint32(72).bool(message.postOnly);
|
|
16195
|
+
}
|
|
16196
|
+
if (message.builderAddress !== "") {
|
|
16197
|
+
writer.uint32(82).string(message.builderAddress);
|
|
16198
|
+
}
|
|
16199
|
+
if (message.builderFeeRate !== "") {
|
|
16200
|
+
writer.uint32(90).string(message.builderFeeRate);
|
|
16201
|
+
}
|
|
16202
|
+
return writer;
|
|
16203
|
+
},
|
|
16204
|
+
decode(input, length) {
|
|
16205
|
+
const reader = input instanceof import_wire37.BinaryReader ? input : new import_wire37.BinaryReader(input);
|
|
16206
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
16207
|
+
const message = createBaseMsgPlaceScaleOrder();
|
|
16208
|
+
while (reader.pos < end) {
|
|
16209
|
+
const tag = reader.uint32();
|
|
16210
|
+
switch (tag >>> 3) {
|
|
16211
|
+
case 1: {
|
|
16212
|
+
if (tag !== 10) {
|
|
16213
|
+
break;
|
|
16214
|
+
}
|
|
16215
|
+
message.sender = reader.string();
|
|
16216
|
+
continue;
|
|
16217
|
+
}
|
|
16218
|
+
case 2: {
|
|
16219
|
+
if (tag !== 18) {
|
|
16220
|
+
break;
|
|
16221
|
+
}
|
|
16222
|
+
message.marketId = reader.bytes();
|
|
16223
|
+
continue;
|
|
16224
|
+
}
|
|
16225
|
+
case 3: {
|
|
15915
16226
|
if (tag !== 24) {
|
|
15916
16227
|
break;
|
|
15917
16228
|
}
|
|
@@ -15957,7 +16268,7 @@ var MsgPlaceScaleOrder = {
|
|
|
15957
16268
|
if (tag !== 66) {
|
|
15958
16269
|
break;
|
|
15959
16270
|
}
|
|
15960
|
-
message.
|
|
16271
|
+
message.deadline = fromTimestamp7(Timestamp.decode(reader, reader.uint32()));
|
|
15961
16272
|
continue;
|
|
15962
16273
|
}
|
|
15963
16274
|
case 9: {
|
|
@@ -15998,7 +16309,7 @@ var MsgPlaceScaleOrder = {
|
|
|
15998
16309
|
highPrice: isSet35(object2.highPrice) ? globalThis.String(object2.highPrice) : isSet35(object2.high_price) ? globalThis.String(object2.high_price) : "",
|
|
15999
16310
|
totalQuantity: isSet35(object2.totalQuantity) ? globalThis.String(object2.totalQuantity) : isSet35(object2.total_quantity) ? globalThis.String(object2.total_quantity) : "",
|
|
16000
16311
|
weights: globalThis.Array.isArray(object2?.weights) ? object2.weights.map((e) => globalThis.Number(e)) : [],
|
|
16001
|
-
|
|
16312
|
+
deadline: isSet35(object2.deadline) ? fromJsonTimestamp7(object2.deadline) : void 0,
|
|
16002
16313
|
postOnly: isSet35(object2.postOnly) ? globalThis.Boolean(object2.postOnly) : isSet35(object2.post_only) ? globalThis.Boolean(object2.post_only) : false,
|
|
16003
16314
|
builderAddress: isSet35(object2.builderAddress) ? globalThis.String(object2.builderAddress) : isSet35(object2.builder_address) ? globalThis.String(object2.builder_address) : "",
|
|
16004
16315
|
builderFeeRate: isSet35(object2.builderFeeRate) ? globalThis.String(object2.builderFeeRate) : isSet35(object2.builder_fee_rate) ? globalThis.String(object2.builder_fee_rate) : ""
|
|
@@ -16027,36 +16338,187 @@ var MsgPlaceScaleOrder = {
|
|
|
16027
16338
|
if (message.weights?.length) {
|
|
16028
16339
|
obj.weights = message.weights.map((e) => Math.round(e));
|
|
16029
16340
|
}
|
|
16030
|
-
if (message.
|
|
16031
|
-
obj.
|
|
16341
|
+
if (message.deadline !== void 0) {
|
|
16342
|
+
obj.deadline = message.deadline.toISOString();
|
|
16032
16343
|
}
|
|
16033
16344
|
if (message.postOnly !== false) {
|
|
16034
16345
|
obj.postOnly = message.postOnly;
|
|
16035
16346
|
}
|
|
16036
|
-
if (message.builderAddress !== "") {
|
|
16037
|
-
obj.builderAddress = message.builderAddress;
|
|
16347
|
+
if (message.builderAddress !== "") {
|
|
16348
|
+
obj.builderAddress = message.builderAddress;
|
|
16349
|
+
}
|
|
16350
|
+
if (message.builderFeeRate !== "") {
|
|
16351
|
+
obj.builderFeeRate = message.builderFeeRate;
|
|
16352
|
+
}
|
|
16353
|
+
return obj;
|
|
16354
|
+
},
|
|
16355
|
+
create(base) {
|
|
16356
|
+
return MsgPlaceScaleOrder.fromPartial(base ?? {});
|
|
16357
|
+
},
|
|
16358
|
+
fromPartial(object2) {
|
|
16359
|
+
const message = createBaseMsgPlaceScaleOrder();
|
|
16360
|
+
message.sender = object2.sender ?? "";
|
|
16361
|
+
message.marketId = object2.marketId ?? new Uint8Array(0);
|
|
16362
|
+
message.isBuy = object2.isBuy ?? false;
|
|
16363
|
+
message.lowPrice = object2.lowPrice ?? "";
|
|
16364
|
+
message.highPrice = object2.highPrice ?? "";
|
|
16365
|
+
message.totalQuantity = object2.totalQuantity ?? "";
|
|
16366
|
+
message.weights = object2.weights?.map((e) => e) || [];
|
|
16367
|
+
message.deadline = object2.deadline ?? void 0;
|
|
16368
|
+
message.postOnly = object2.postOnly ?? false;
|
|
16369
|
+
message.builderAddress = object2.builderAddress ?? "";
|
|
16370
|
+
message.builderFeeRate = object2.builderFeeRate ?? "";
|
|
16371
|
+
return message;
|
|
16372
|
+
}
|
|
16373
|
+
};
|
|
16374
|
+
function createBaseMsgPlaceScaleOrderResponse() {
|
|
16375
|
+
return { orders: [], escrowedAmount: void 0 };
|
|
16376
|
+
}
|
|
16377
|
+
var MsgPlaceScaleOrderResponse = {
|
|
16378
|
+
encode(message, writer = new import_wire37.BinaryWriter()) {
|
|
16379
|
+
for (const v of message.orders) {
|
|
16380
|
+
ScaleOrderResult.encode(v, writer.uint32(10).fork()).join();
|
|
16381
|
+
}
|
|
16382
|
+
if (message.escrowedAmount !== void 0) {
|
|
16383
|
+
Coin.encode(message.escrowedAmount, writer.uint32(18).fork()).join();
|
|
16384
|
+
}
|
|
16385
|
+
return writer;
|
|
16386
|
+
},
|
|
16387
|
+
decode(input, length) {
|
|
16388
|
+
const reader = input instanceof import_wire37.BinaryReader ? input : new import_wire37.BinaryReader(input);
|
|
16389
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
16390
|
+
const message = createBaseMsgPlaceScaleOrderResponse();
|
|
16391
|
+
while (reader.pos < end) {
|
|
16392
|
+
const tag = reader.uint32();
|
|
16393
|
+
switch (tag >>> 3) {
|
|
16394
|
+
case 1: {
|
|
16395
|
+
if (tag !== 10) {
|
|
16396
|
+
break;
|
|
16397
|
+
}
|
|
16398
|
+
message.orders.push(ScaleOrderResult.decode(reader, reader.uint32()));
|
|
16399
|
+
continue;
|
|
16400
|
+
}
|
|
16401
|
+
case 2: {
|
|
16402
|
+
if (tag !== 18) {
|
|
16403
|
+
break;
|
|
16404
|
+
}
|
|
16405
|
+
message.escrowedAmount = Coin.decode(reader, reader.uint32());
|
|
16406
|
+
continue;
|
|
16407
|
+
}
|
|
16408
|
+
}
|
|
16409
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
16410
|
+
break;
|
|
16411
|
+
}
|
|
16412
|
+
reader.skip(tag & 7);
|
|
16413
|
+
}
|
|
16414
|
+
return message;
|
|
16415
|
+
},
|
|
16416
|
+
fromJSON(object2) {
|
|
16417
|
+
return {
|
|
16418
|
+
orders: globalThis.Array.isArray(object2?.orders) ? object2.orders.map((e) => ScaleOrderResult.fromJSON(e)) : [],
|
|
16419
|
+
escrowedAmount: isSet35(object2.escrowedAmount) ? Coin.fromJSON(object2.escrowedAmount) : isSet35(object2.escrowed_amount) ? Coin.fromJSON(object2.escrowed_amount) : void 0
|
|
16420
|
+
};
|
|
16421
|
+
},
|
|
16422
|
+
toJSON(message) {
|
|
16423
|
+
const obj = {};
|
|
16424
|
+
if (message.orders?.length) {
|
|
16425
|
+
obj.orders = message.orders.map((e) => ScaleOrderResult.toJSON(e));
|
|
16426
|
+
}
|
|
16427
|
+
if (message.escrowedAmount !== void 0) {
|
|
16428
|
+
obj.escrowedAmount = Coin.toJSON(message.escrowedAmount);
|
|
16429
|
+
}
|
|
16430
|
+
return obj;
|
|
16431
|
+
},
|
|
16432
|
+
create(base) {
|
|
16433
|
+
return MsgPlaceScaleOrderResponse.fromPartial(base ?? {});
|
|
16434
|
+
},
|
|
16435
|
+
fromPartial(object2) {
|
|
16436
|
+
const message = createBaseMsgPlaceScaleOrderResponse();
|
|
16437
|
+
message.orders = object2.orders?.map((e) => ScaleOrderResult.fromPartial(e)) || [];
|
|
16438
|
+
message.escrowedAmount = object2.escrowedAmount !== void 0 && object2.escrowedAmount !== null ? Coin.fromPartial(object2.escrowedAmount) : void 0;
|
|
16439
|
+
return message;
|
|
16440
|
+
}
|
|
16441
|
+
};
|
|
16442
|
+
function createBaseScaleOrderResult() {
|
|
16443
|
+
return { orderId: new Uint8Array(0), price: "", quantity: "" };
|
|
16444
|
+
}
|
|
16445
|
+
var ScaleOrderResult = {
|
|
16446
|
+
encode(message, writer = new import_wire37.BinaryWriter()) {
|
|
16447
|
+
if (message.orderId.length !== 0) {
|
|
16448
|
+
writer.uint32(10).bytes(message.orderId);
|
|
16449
|
+
}
|
|
16450
|
+
if (message.price !== "") {
|
|
16451
|
+
writer.uint32(18).string(message.price);
|
|
16452
|
+
}
|
|
16453
|
+
if (message.quantity !== "") {
|
|
16454
|
+
writer.uint32(26).string(message.quantity);
|
|
16455
|
+
}
|
|
16456
|
+
return writer;
|
|
16457
|
+
},
|
|
16458
|
+
decode(input, length) {
|
|
16459
|
+
const reader = input instanceof import_wire37.BinaryReader ? input : new import_wire37.BinaryReader(input);
|
|
16460
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
16461
|
+
const message = createBaseScaleOrderResult();
|
|
16462
|
+
while (reader.pos < end) {
|
|
16463
|
+
const tag = reader.uint32();
|
|
16464
|
+
switch (tag >>> 3) {
|
|
16465
|
+
case 1: {
|
|
16466
|
+
if (tag !== 10) {
|
|
16467
|
+
break;
|
|
16468
|
+
}
|
|
16469
|
+
message.orderId = reader.bytes();
|
|
16470
|
+
continue;
|
|
16471
|
+
}
|
|
16472
|
+
case 2: {
|
|
16473
|
+
if (tag !== 18) {
|
|
16474
|
+
break;
|
|
16475
|
+
}
|
|
16476
|
+
message.price = reader.string();
|
|
16477
|
+
continue;
|
|
16478
|
+
}
|
|
16479
|
+
case 3: {
|
|
16480
|
+
if (tag !== 26) {
|
|
16481
|
+
break;
|
|
16482
|
+
}
|
|
16483
|
+
message.quantity = reader.string();
|
|
16484
|
+
continue;
|
|
16485
|
+
}
|
|
16486
|
+
}
|
|
16487
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
16488
|
+
break;
|
|
16489
|
+
}
|
|
16490
|
+
reader.skip(tag & 7);
|
|
16491
|
+
}
|
|
16492
|
+
return message;
|
|
16493
|
+
},
|
|
16494
|
+
fromJSON(object2) {
|
|
16495
|
+
return {
|
|
16496
|
+
orderId: isSet35(object2.orderId) ? bytesFromBase648(object2.orderId) : isSet35(object2.order_id) ? bytesFromBase648(object2.order_id) : new Uint8Array(0),
|
|
16497
|
+
price: isSet35(object2.price) ? globalThis.String(object2.price) : "",
|
|
16498
|
+
quantity: isSet35(object2.quantity) ? globalThis.String(object2.quantity) : ""
|
|
16499
|
+
};
|
|
16500
|
+
},
|
|
16501
|
+
toJSON(message) {
|
|
16502
|
+
const obj = {};
|
|
16503
|
+
if (message.orderId.length !== 0) {
|
|
16504
|
+
obj.orderId = base64FromBytes8(message.orderId);
|
|
16505
|
+
}
|
|
16506
|
+
if (message.price !== "") {
|
|
16507
|
+
obj.price = message.price;
|
|
16038
16508
|
}
|
|
16039
|
-
if (message.
|
|
16040
|
-
obj.
|
|
16509
|
+
if (message.quantity !== "") {
|
|
16510
|
+
obj.quantity = message.quantity;
|
|
16041
16511
|
}
|
|
16042
16512
|
return obj;
|
|
16043
16513
|
},
|
|
16044
16514
|
create(base) {
|
|
16045
|
-
return
|
|
16515
|
+
return ScaleOrderResult.fromPartial(base ?? {});
|
|
16046
16516
|
},
|
|
16047
16517
|
fromPartial(object2) {
|
|
16048
|
-
const message =
|
|
16049
|
-
message.
|
|
16050
|
-
message.
|
|
16051
|
-
message.
|
|
16052
|
-
message.lowPrice = object2.lowPrice ?? "";
|
|
16053
|
-
message.highPrice = object2.highPrice ?? "";
|
|
16054
|
-
message.totalQuantity = object2.totalQuantity ?? "";
|
|
16055
|
-
message.weights = object2.weights?.map((e) => e) || [];
|
|
16056
|
-
message.lifespan = object2.lifespan !== void 0 && object2.lifespan !== null ? Duration.fromPartial(object2.lifespan) : void 0;
|
|
16057
|
-
message.postOnly = object2.postOnly ?? false;
|
|
16058
|
-
message.builderAddress = object2.builderAddress ?? "";
|
|
16059
|
-
message.builderFeeRate = object2.builderFeeRate ?? "";
|
|
16518
|
+
const message = createBaseScaleOrderResult();
|
|
16519
|
+
message.orderId = object2.orderId ?? new Uint8Array(0);
|
|
16520
|
+
message.price = object2.price ?? "";
|
|
16521
|
+
message.quantity = object2.quantity ?? "";
|
|
16060
16522
|
return message;
|
|
16061
16523
|
}
|
|
16062
16524
|
};
|
|
@@ -16151,6 +16613,25 @@ function base64FromBytes8(arr) {
|
|
|
16151
16613
|
return globalThis.btoa(bin.join(""));
|
|
16152
16614
|
}
|
|
16153
16615
|
}
|
|
16616
|
+
function toTimestamp7(date) {
|
|
16617
|
+
const seconds = BigInt(Math.trunc(date.getTime() / 1e3));
|
|
16618
|
+
const nanos = date.getTime() % 1e3 * 1e6;
|
|
16619
|
+
return { seconds, nanos };
|
|
16620
|
+
}
|
|
16621
|
+
function fromTimestamp7(t) {
|
|
16622
|
+
let millis = (globalThis.Number(t.seconds.toString()) || 0) * 1e3;
|
|
16623
|
+
millis += (t.nanos || 0) / 1e6;
|
|
16624
|
+
return new globalThis.Date(millis);
|
|
16625
|
+
}
|
|
16626
|
+
function fromJsonTimestamp7(o) {
|
|
16627
|
+
if (o instanceof globalThis.Date) {
|
|
16628
|
+
return o;
|
|
16629
|
+
} else if (typeof o === "string") {
|
|
16630
|
+
return new globalThis.Date(o);
|
|
16631
|
+
} else {
|
|
16632
|
+
return fromTimestamp7(Timestamp.fromJSON(o));
|
|
16633
|
+
}
|
|
16634
|
+
}
|
|
16154
16635
|
function isSet35(value) {
|
|
16155
16636
|
return value !== null && value !== void 0;
|
|
16156
16637
|
}
|
|
@@ -17227,7 +17708,15 @@ function isSet36(value) {
|
|
|
17227
17708
|
// src/proto/gen/ault/market/v1/tx.ts
|
|
17228
17709
|
var import_wire39 = require("@bufbuild/protobuf/wire");
|
|
17229
17710
|
function createBaseMsgCreateMarket() {
|
|
17230
|
-
return {
|
|
17711
|
+
return {
|
|
17712
|
+
sender: "",
|
|
17713
|
+
marketType: 0,
|
|
17714
|
+
baseDenom: "",
|
|
17715
|
+
quoteDenom: "",
|
|
17716
|
+
tickPrecision: 0,
|
|
17717
|
+
makerFeeRate: "",
|
|
17718
|
+
takerFeeRate: ""
|
|
17719
|
+
};
|
|
17231
17720
|
}
|
|
17232
17721
|
var MsgCreateMarket = {
|
|
17233
17722
|
encode(message, writer = new import_wire39.BinaryWriter()) {
|
|
@@ -17246,6 +17735,12 @@ var MsgCreateMarket = {
|
|
|
17246
17735
|
if (message.tickPrecision !== 0) {
|
|
17247
17736
|
writer.uint32(40).uint32(message.tickPrecision);
|
|
17248
17737
|
}
|
|
17738
|
+
if (message.makerFeeRate !== "") {
|
|
17739
|
+
writer.uint32(50).string(message.makerFeeRate);
|
|
17740
|
+
}
|
|
17741
|
+
if (message.takerFeeRate !== "") {
|
|
17742
|
+
writer.uint32(58).string(message.takerFeeRate);
|
|
17743
|
+
}
|
|
17249
17744
|
return writer;
|
|
17250
17745
|
},
|
|
17251
17746
|
decode(input, length) {
|
|
@@ -17290,6 +17785,20 @@ var MsgCreateMarket = {
|
|
|
17290
17785
|
message.tickPrecision = reader.uint32();
|
|
17291
17786
|
continue;
|
|
17292
17787
|
}
|
|
17788
|
+
case 6: {
|
|
17789
|
+
if (tag !== 50) {
|
|
17790
|
+
break;
|
|
17791
|
+
}
|
|
17792
|
+
message.makerFeeRate = reader.string();
|
|
17793
|
+
continue;
|
|
17794
|
+
}
|
|
17795
|
+
case 7: {
|
|
17796
|
+
if (tag !== 58) {
|
|
17797
|
+
break;
|
|
17798
|
+
}
|
|
17799
|
+
message.takerFeeRate = reader.string();
|
|
17800
|
+
continue;
|
|
17801
|
+
}
|
|
17293
17802
|
}
|
|
17294
17803
|
if ((tag & 7) === 4 || tag === 0) {
|
|
17295
17804
|
break;
|
|
@@ -17304,7 +17813,9 @@ var MsgCreateMarket = {
|
|
|
17304
17813
|
marketType: isSet37(object2.marketType) ? marketTypeFromJSON(object2.marketType) : isSet37(object2.market_type) ? marketTypeFromJSON(object2.market_type) : 0,
|
|
17305
17814
|
baseDenom: isSet37(object2.baseDenom) ? globalThis.String(object2.baseDenom) : isSet37(object2.base_denom) ? globalThis.String(object2.base_denom) : "",
|
|
17306
17815
|
quoteDenom: isSet37(object2.quoteDenom) ? globalThis.String(object2.quoteDenom) : isSet37(object2.quote_denom) ? globalThis.String(object2.quote_denom) : "",
|
|
17307
|
-
tickPrecision: isSet37(object2.tickPrecision) ? globalThis.Number(object2.tickPrecision) : isSet37(object2.tick_precision) ? globalThis.Number(object2.tick_precision) : 0
|
|
17816
|
+
tickPrecision: isSet37(object2.tickPrecision) ? globalThis.Number(object2.tickPrecision) : isSet37(object2.tick_precision) ? globalThis.Number(object2.tick_precision) : 0,
|
|
17817
|
+
makerFeeRate: isSet37(object2.makerFeeRate) ? globalThis.String(object2.makerFeeRate) : isSet37(object2.maker_fee_rate) ? globalThis.String(object2.maker_fee_rate) : "",
|
|
17818
|
+
takerFeeRate: isSet37(object2.takerFeeRate) ? globalThis.String(object2.takerFeeRate) : isSet37(object2.taker_fee_rate) ? globalThis.String(object2.taker_fee_rate) : ""
|
|
17308
17819
|
};
|
|
17309
17820
|
},
|
|
17310
17821
|
toJSON(message) {
|
|
@@ -17324,6 +17835,12 @@ var MsgCreateMarket = {
|
|
|
17324
17835
|
if (message.tickPrecision !== 0) {
|
|
17325
17836
|
obj.tickPrecision = Math.round(message.tickPrecision);
|
|
17326
17837
|
}
|
|
17838
|
+
if (message.makerFeeRate !== "") {
|
|
17839
|
+
obj.makerFeeRate = message.makerFeeRate;
|
|
17840
|
+
}
|
|
17841
|
+
if (message.takerFeeRate !== "") {
|
|
17842
|
+
obj.takerFeeRate = message.takerFeeRate;
|
|
17843
|
+
}
|
|
17327
17844
|
return obj;
|
|
17328
17845
|
},
|
|
17329
17846
|
create(base) {
|
|
@@ -17336,6 +17853,8 @@ var MsgCreateMarket = {
|
|
|
17336
17853
|
message.baseDenom = object2.baseDenom ?? "";
|
|
17337
17854
|
message.quoteDenom = object2.quoteDenom ?? "";
|
|
17338
17855
|
message.tickPrecision = object2.tickPrecision ?? 0;
|
|
17856
|
+
message.makerFeeRate = object2.makerFeeRate ?? "";
|
|
17857
|
+
message.takerFeeRate = object2.takerFeeRate ?? "";
|
|
17339
17858
|
return message;
|
|
17340
17859
|
}
|
|
17341
17860
|
};
|
|
@@ -20496,12 +21015,6 @@ function requireRecordArray(value, label) {
|
|
|
20496
21015
|
return item;
|
|
20497
21016
|
});
|
|
20498
21017
|
}
|
|
20499
|
-
function optionalDuration(value, label) {
|
|
20500
|
-
if (value === void 0) {
|
|
20501
|
-
return void 0;
|
|
20502
|
-
}
|
|
20503
|
-
return requireDuration(value, label);
|
|
20504
|
-
}
|
|
20505
21018
|
function requireDuration(value, label) {
|
|
20506
21019
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
20507
21020
|
throw new Error(`${label} must be a protobuf Duration object.`);
|
|
@@ -20529,6 +21042,40 @@ function requireDurationOrDefault(value, label, defaultValue = { seconds: 0n, na
|
|
|
20529
21042
|
}
|
|
20530
21043
|
return requireDuration(value, label);
|
|
20531
21044
|
}
|
|
21045
|
+
function optionalTimestamp(value, label) {
|
|
21046
|
+
if (value === void 0 || value === null) {
|
|
21047
|
+
return void 0;
|
|
21048
|
+
}
|
|
21049
|
+
return requireTimestamp(value, label);
|
|
21050
|
+
}
|
|
21051
|
+
function requireTimestamp(value, label) {
|
|
21052
|
+
if (value instanceof Date) {
|
|
21053
|
+
if (Number.isNaN(value.getTime())) {
|
|
21054
|
+
throw new Error(`${label} must be a valid Date.`);
|
|
21055
|
+
}
|
|
21056
|
+
return value;
|
|
21057
|
+
}
|
|
21058
|
+
if (typeof value === "string") {
|
|
21059
|
+
const parsed = new Date(value);
|
|
21060
|
+
if (Number.isNaN(parsed.getTime())) {
|
|
21061
|
+
throw new Error(`${label} must be a valid RFC 3339 date string.`);
|
|
21062
|
+
}
|
|
21063
|
+
return parsed;
|
|
21064
|
+
}
|
|
21065
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
21066
|
+
const record2 = asRecord(value);
|
|
21067
|
+
if (record2.seconds === void 0 && record2.nanos === void 0) {
|
|
21068
|
+
throw new Error(`${label} must include seconds or nanos.`);
|
|
21069
|
+
}
|
|
21070
|
+
const seconds = requireBigIntLike(record2.seconds ?? 0n, `${label}.seconds`);
|
|
21071
|
+
const nanos = requireInt32Like(record2.nanos ?? 0, `${label}.nanos`);
|
|
21072
|
+
if (nanos < 0 || nanos > 999999999) {
|
|
21073
|
+
throw new Error(`${label}.nanos must be between 0 and 999999999.`);
|
|
21074
|
+
}
|
|
21075
|
+
return new Date(Number(seconds) * 1e3 + Math.floor(nanos / 1e6));
|
|
21076
|
+
}
|
|
21077
|
+
throw new Error(`${label} must be a Date, RFC 3339 string, or protobuf Timestamp object.`);
|
|
21078
|
+
}
|
|
20532
21079
|
function mapAultAccountxV1MsgOpenAccount(input, label = "value") {
|
|
20533
21080
|
const record2 = asRecord(input);
|
|
20534
21081
|
const prefix = label ? `${label}.` : "";
|
|
@@ -20562,7 +21109,7 @@ function mapAultAgentV1MsgApproveAgent(input, label = "value") {
|
|
|
20562
21109
|
masterAddress: requireString(record2["masterAddress"], `${prefix}masterAddress`),
|
|
20563
21110
|
agentPubkey: mapGoogleProtobufAny(asRecord(record2["agentPubkey"]), `${prefix}agentPubkey`),
|
|
20564
21111
|
name: requireStringOrDefault(record2["name"], `${prefix}name`),
|
|
20565
|
-
|
|
21112
|
+
expiresAt: optionalTimestamp(record2["expiresAt"], `${prefix}expiresAt`)
|
|
20566
21113
|
};
|
|
20567
21114
|
}
|
|
20568
21115
|
function mapAultAgentV1MsgRevokeAgent(input, label = "value") {
|
|
@@ -20611,6 +21158,17 @@ function mapAultAuthorityV1MsgRevokeRole(input, label = "value") {
|
|
|
20611
21158
|
members: requireStringArray(record2["members"], `${prefix}members`)
|
|
20612
21159
|
};
|
|
20613
21160
|
}
|
|
21161
|
+
function mapAultClobV1ModifyOrder(input, label = "value") {
|
|
21162
|
+
const record2 = asRecord(input);
|
|
21163
|
+
const prefix = label ? `${label}.` : "";
|
|
21164
|
+
return {
|
|
21165
|
+
orderId: requireBytes(record2["orderId"], `${prefix}orderId`),
|
|
21166
|
+
newPrice: cosmosDecToProtoInt(requireStringOrDefault(record2["newPrice"], `${prefix}newPrice`)),
|
|
21167
|
+
newQuantity: cosmosDecToProtoInt(
|
|
21168
|
+
requireStringOrDefault(record2["newQuantity"], `${prefix}newQuantity`)
|
|
21169
|
+
)
|
|
21170
|
+
};
|
|
21171
|
+
}
|
|
20614
21172
|
function mapAultClobV1MsgCancelOrders(input, label = "value") {
|
|
20615
21173
|
const record2 = asRecord(input);
|
|
20616
21174
|
const prefix = label ? `${label}.` : "";
|
|
@@ -20619,6 +21177,16 @@ function mapAultClobV1MsgCancelOrders(input, label = "value") {
|
|
|
20619
21177
|
orderIds: requireBytesArray(record2["orderIds"], `${prefix}orderIds`)
|
|
20620
21178
|
};
|
|
20621
21179
|
}
|
|
21180
|
+
function mapAultClobV1MsgModifyOrders(input, label = "value") {
|
|
21181
|
+
const record2 = asRecord(input);
|
|
21182
|
+
const prefix = label ? `${label}.` : "";
|
|
21183
|
+
return {
|
|
21184
|
+
sender: requireString(record2["sender"], `${prefix}sender`),
|
|
21185
|
+
orders: requireRecordArray(record2["orders"], `${prefix}orders`).map(
|
|
21186
|
+
(item, index) => mapAultClobV1ModifyOrder(item, `${prefix}orders[${index}]`)
|
|
21187
|
+
)
|
|
21188
|
+
};
|
|
21189
|
+
}
|
|
20622
21190
|
function mapAultClobV1MsgPlaceLimitOrder(input, label = "value") {
|
|
20623
21191
|
const record2 = asRecord(input);
|
|
20624
21192
|
const prefix = label ? `${label}.` : "";
|
|
@@ -20628,7 +21196,7 @@ function mapAultClobV1MsgPlaceLimitOrder(input, label = "value") {
|
|
|
20628
21196
|
isBuy: requireBool(record2["isBuy"], `${prefix}isBuy`),
|
|
20629
21197
|
price: cosmosDecToProtoInt(requireString(record2["price"], `${prefix}price`)),
|
|
20630
21198
|
quantity: cosmosDecToProtoInt(requireString(record2["quantity"], `${prefix}quantity`)),
|
|
20631
|
-
|
|
21199
|
+
deadline: requireTimestamp(record2["deadline"], `${prefix}deadline`),
|
|
20632
21200
|
postOnly: requireBoolOrDefault(record2["postOnly"], `${prefix}postOnly`),
|
|
20633
21201
|
builderAddress: requireStringOrDefault(record2["builderAddress"], `${prefix}builderAddress`),
|
|
20634
21202
|
builderFeeRate: cosmosDecToProtoInt(
|
|
@@ -20669,7 +21237,7 @@ function mapAultClobV1MsgPlaceScaleOrder(input, label = "value") {
|
|
|
20669
21237
|
requireString(record2["totalQuantity"], `${prefix}totalQuantity`)
|
|
20670
21238
|
),
|
|
20671
21239
|
weights: requireUint32Array(record2["weights"], `${prefix}weights`),
|
|
20672
|
-
|
|
21240
|
+
deadline: requireTimestamp(record2["deadline"], `${prefix}deadline`),
|
|
20673
21241
|
postOnly: requireBoolOrDefault(record2["postOnly"], `${prefix}postOnly`),
|
|
20674
21242
|
builderAddress: requireStringOrDefault(record2["builderAddress"], `${prefix}builderAddress`),
|
|
20675
21243
|
builderFeeRate: cosmosDecToProtoInt(
|
|
@@ -20900,7 +21468,13 @@ function mapAultMarketV1MsgCreateMarket(input, label = "value") {
|
|
|
20900
21468
|
),
|
|
20901
21469
|
baseDenom: requireString(record2["baseDenom"], `${prefix}baseDenom`),
|
|
20902
21470
|
quoteDenom: requireString(record2["quoteDenom"], `${prefix}quoteDenom`),
|
|
20903
|
-
tickPrecision: requireUint32Like(record2["tickPrecision"], `${prefix}tickPrecision`)
|
|
21471
|
+
tickPrecision: requireUint32Like(record2["tickPrecision"], `${prefix}tickPrecision`),
|
|
21472
|
+
makerFeeRate: cosmosDecToProtoInt(
|
|
21473
|
+
requireStringOrDefault(record2["makerFeeRate"], `${prefix}makerFeeRate`)
|
|
21474
|
+
),
|
|
21475
|
+
takerFeeRate: cosmosDecToProtoInt(
|
|
21476
|
+
requireStringOrDefault(record2["takerFeeRate"], `${prefix}takerFeeRate`)
|
|
21477
|
+
)
|
|
20904
21478
|
};
|
|
20905
21479
|
}
|
|
20906
21480
|
function mapAultMarketV1MsgHaltAllMarkets(input, label = "value") {
|
|
@@ -21434,6 +22008,9 @@ var MSG_ENCODERS = {
|
|
|
21434
22008
|
"/ault.clob.v1.MsgCancelOrders": (value) => MsgCancelOrders.encode(
|
|
21435
22009
|
MsgCancelOrders.fromPartial(mapAultClobV1MsgCancelOrders(value))
|
|
21436
22010
|
).finish(),
|
|
22011
|
+
"/ault.clob.v1.MsgModifyOrders": (value) => MsgModifyOrders.encode(
|
|
22012
|
+
MsgModifyOrders.fromPartial(mapAultClobV1MsgModifyOrders(value))
|
|
22013
|
+
).finish(),
|
|
21437
22014
|
"/ault.clob.v1.MsgPlaceLimitOrder": (value) => MsgPlaceLimitOrder.encode(
|
|
21438
22015
|
MsgPlaceLimitOrder.fromPartial(mapAultClobV1MsgPlaceLimitOrder(value))
|
|
21439
22016
|
).finish(),
|
|
@@ -21701,6 +22278,7 @@ async function pollTxInclusion(network, txHash, fetchFn, fetchOptions, timeoutMs
|
|
|
21701
22278
|
return {
|
|
21702
22279
|
code: result.tx_response.code,
|
|
21703
22280
|
rawLog: result.tx_response.raw_log,
|
|
22281
|
+
data: result.tx_response.data,
|
|
21704
22282
|
confirmed: true
|
|
21705
22283
|
};
|
|
21706
22284
|
} catch (error) {
|
|
@@ -21749,6 +22327,7 @@ async function signAndBroadcastEip712({
|
|
|
21749
22327
|
feeDenom,
|
|
21750
22328
|
feeAmount,
|
|
21751
22329
|
confirmationTimeoutMs,
|
|
22330
|
+
wait = true,
|
|
21752
22331
|
fetchFn,
|
|
21753
22332
|
fetchOptions,
|
|
21754
22333
|
cache,
|
|
@@ -21847,6 +22426,15 @@ async function signAndBroadcastEip712({
|
|
|
21847
22426
|
confirmed: true
|
|
21848
22427
|
});
|
|
21849
22428
|
}
|
|
22429
|
+
if (!wait) {
|
|
22430
|
+
if (cache) cache.nextSequence = getNextSequence(sequence);
|
|
22431
|
+
return {
|
|
22432
|
+
txHash,
|
|
22433
|
+
code: 0,
|
|
22434
|
+
rawLog: result.tx_response.raw_log,
|
|
22435
|
+
confirmed: false
|
|
22436
|
+
};
|
|
22437
|
+
}
|
|
21850
22438
|
const deliverResult = await pollTxInclusion(
|
|
21851
22439
|
network,
|
|
21852
22440
|
txHash,
|
|
@@ -21889,6 +22477,7 @@ async function signAndBroadcastEip712({
|
|
|
21889
22477
|
txHash,
|
|
21890
22478
|
code: 0,
|
|
21891
22479
|
rawLog: deliverResult.rawLog,
|
|
22480
|
+
data: deliverResult.data,
|
|
21892
22481
|
confirmed: true
|
|
21893
22482
|
};
|
|
21894
22483
|
}
|
|
@@ -22162,7 +22751,7 @@ function createAgentTxApi({ signerAddress, exec, getGas }) {
|
|
|
22162
22751
|
async approveAgent({
|
|
22163
22752
|
agentPubkey,
|
|
22164
22753
|
name = "",
|
|
22165
|
-
|
|
22754
|
+
expiresAt,
|
|
22166
22755
|
gasLimit,
|
|
22167
22756
|
feeAmount,
|
|
22168
22757
|
memo,
|
|
@@ -22175,7 +22764,7 @@ function createAgentTxApi({ signerAddress, exec, getGas }) {
|
|
|
22175
22764
|
masterAddress: signerAddress,
|
|
22176
22765
|
agentPubkey,
|
|
22177
22766
|
name,
|
|
22178
|
-
|
|
22767
|
+
expiresAt
|
|
22179
22768
|
})
|
|
22180
22769
|
],
|
|
22181
22770
|
{
|
|
@@ -22246,111 +22835,330 @@ function createAuthorityTxApi({ signerAddress, exec }) {
|
|
|
22246
22835
|
}
|
|
22247
22836
|
};
|
|
22248
22837
|
}
|
|
22249
|
-
|
|
22250
|
-
// src/core/clob-msgs.ts
|
|
22251
|
-
function buildLimitOrderMsg(sender, params) {
|
|
22252
|
-
return msg.clob.placeLimitOrder({
|
|
22253
|
-
sender,
|
|
22254
|
-
marketId: params.marketId,
|
|
22255
|
-
isBuy: params.isBuy,
|
|
22256
|
-
price: params.price,
|
|
22257
|
-
quantity: params.quantity,
|
|
22258
|
-
|
|
22259
|
-
...params.postOnly !== void 0 && { postOnly: params.postOnly },
|
|
22260
|
-
...params.builderAddress !== void 0 && {
|
|
22261
|
-
builderAddress: normalizeAddress(params.builderAddress)
|
|
22262
|
-
},
|
|
22263
|
-
...params.builderFeeRate !== void 0 && { builderFeeRate: params.builderFeeRate }
|
|
22264
|
-
});
|
|
22838
|
+
|
|
22839
|
+
// src/core/clob-msgs.ts
|
|
22840
|
+
function buildLimitOrderMsg(sender, params) {
|
|
22841
|
+
return msg.clob.placeLimitOrder({
|
|
22842
|
+
sender,
|
|
22843
|
+
marketId: params.marketId,
|
|
22844
|
+
isBuy: params.isBuy,
|
|
22845
|
+
price: params.price,
|
|
22846
|
+
quantity: params.quantity,
|
|
22847
|
+
deadline: params.deadline,
|
|
22848
|
+
...params.postOnly !== void 0 && { postOnly: params.postOnly },
|
|
22849
|
+
...params.builderAddress !== void 0 && {
|
|
22850
|
+
builderAddress: normalizeAddress(params.builderAddress)
|
|
22851
|
+
},
|
|
22852
|
+
...params.builderFeeRate !== void 0 && { builderFeeRate: params.builderFeeRate }
|
|
22853
|
+
});
|
|
22854
|
+
}
|
|
22855
|
+
function buildMarketOrderMsg(sender, params) {
|
|
22856
|
+
return msg.clob.placeMarketOrder({
|
|
22857
|
+
sender,
|
|
22858
|
+
marketId: params.marketId,
|
|
22859
|
+
isBuy: params.isBuy,
|
|
22860
|
+
deposit: params.deposit,
|
|
22861
|
+
...params.worstPrice !== void 0 && { worstPrice: params.worstPrice },
|
|
22862
|
+
...params.priceTolerance !== void 0 && { priceTolerance: params.priceTolerance },
|
|
22863
|
+
...params.builderAddress !== void 0 && {
|
|
22864
|
+
builderAddress: normalizeAddress(params.builderAddress)
|
|
22865
|
+
},
|
|
22866
|
+
...params.builderFeeRate !== void 0 && { builderFeeRate: params.builderFeeRate }
|
|
22867
|
+
});
|
|
22868
|
+
}
|
|
22869
|
+
function buildCancelOrdersMsg(sender, orderIds) {
|
|
22870
|
+
return msg.clob.cancelOrders({ sender, orderIds });
|
|
22871
|
+
}
|
|
22872
|
+
function buildScaleOrderMsg(sender, params) {
|
|
22873
|
+
return msg.clob.placeScaleOrder({
|
|
22874
|
+
sender,
|
|
22875
|
+
marketId: params.marketId,
|
|
22876
|
+
isBuy: params.isBuy,
|
|
22877
|
+
lowPrice: params.lowPrice,
|
|
22878
|
+
highPrice: params.highPrice,
|
|
22879
|
+
totalQuantity: params.totalQuantity,
|
|
22880
|
+
weights: params.weights,
|
|
22881
|
+
deadline: params.deadline,
|
|
22882
|
+
...params.postOnly !== void 0 && { postOnly: params.postOnly },
|
|
22883
|
+
...params.builderAddress !== void 0 && {
|
|
22884
|
+
builderAddress: normalizeAddress(params.builderAddress)
|
|
22885
|
+
},
|
|
22886
|
+
...params.builderFeeRate !== void 0 && { builderFeeRate: params.builderFeeRate }
|
|
22887
|
+
});
|
|
22888
|
+
}
|
|
22889
|
+
|
|
22890
|
+
// src/utils/opaque-id.ts
|
|
22891
|
+
var import_viem4 = require("viem");
|
|
22892
|
+
function decodeHex(input) {
|
|
22893
|
+
const clean = input.startsWith("0x") || input.startsWith("0X") ? input.slice(2) : input;
|
|
22894
|
+
if (clean.length % 2 !== 0) {
|
|
22895
|
+
throw new Error(`invalid hex length: "${input}"`);
|
|
22896
|
+
}
|
|
22897
|
+
if (clean.length > 0 && !/^[0-9a-fA-F]+$/.test(clean)) {
|
|
22898
|
+
throw new Error(`invalid hex characters: "${input}"`);
|
|
22899
|
+
}
|
|
22900
|
+
return (0, import_viem4.hexToBytes)(`0x${clean}`);
|
|
22901
|
+
}
|
|
22902
|
+
function encodeHex(bytes) {
|
|
22903
|
+
return (0, import_viem4.bytesToHex)(bytes).slice(2);
|
|
22904
|
+
}
|
|
22905
|
+
function bytesEqual(a, b) {
|
|
22906
|
+
if (a.length !== b.length) return false;
|
|
22907
|
+
for (let i = 0; i < a.length; i++) {
|
|
22908
|
+
if (a[i] !== b[i]) return false;
|
|
22909
|
+
}
|
|
22910
|
+
return true;
|
|
22911
|
+
}
|
|
22912
|
+
var OpaqueId = class {
|
|
22913
|
+
constructor(bytes) {
|
|
22914
|
+
this.bytes = bytes;
|
|
22915
|
+
}
|
|
22916
|
+
toBytes() {
|
|
22917
|
+
return new Uint8Array(this.bytes);
|
|
22918
|
+
}
|
|
22919
|
+
toHex() {
|
|
22920
|
+
return encodeHex(this.bytes);
|
|
22921
|
+
}
|
|
22922
|
+
toBase64() {
|
|
22923
|
+
return bytesToBase64(this.bytes);
|
|
22924
|
+
}
|
|
22925
|
+
toString() {
|
|
22926
|
+
return this.toHex();
|
|
22927
|
+
}
|
|
22928
|
+
equalsBytes(other) {
|
|
22929
|
+
return bytesEqual(this.bytes, other.bytes);
|
|
22930
|
+
}
|
|
22931
|
+
};
|
|
22932
|
+
var MarketId = class _MarketId extends OpaqueId {
|
|
22933
|
+
static fromHex(hex) {
|
|
22934
|
+
return new _MarketId(_MarketId.assertNonEmpty(decodeHex(hex), `hex "${hex}"`));
|
|
22935
|
+
}
|
|
22936
|
+
static fromBase64(b64) {
|
|
22937
|
+
return new _MarketId(_MarketId.assertNonEmpty(base64ToBytes(b64), `base64 "${b64}"`));
|
|
22938
|
+
}
|
|
22939
|
+
static fromBytes(bytes) {
|
|
22940
|
+
return new _MarketId(_MarketId.assertNonEmpty(new Uint8Array(bytes), "bytes"));
|
|
22941
|
+
}
|
|
22942
|
+
static assertNonEmpty(bytes, source) {
|
|
22943
|
+
if (bytes.length === 0) {
|
|
22944
|
+
throw new Error(`MarketId: empty bytes from ${source}`);
|
|
22945
|
+
}
|
|
22946
|
+
return bytes;
|
|
22947
|
+
}
|
|
22948
|
+
equals(other) {
|
|
22949
|
+
return this.equalsBytes(other);
|
|
22950
|
+
}
|
|
22951
|
+
};
|
|
22952
|
+
var ORDER_ID_LENGTH = 16;
|
|
22953
|
+
var OrderId = class _OrderId extends OpaqueId {
|
|
22954
|
+
static fromHex(hex) {
|
|
22955
|
+
return new _OrderId(_OrderId.assertLength(decodeHex(hex), `hex "${hex}"`));
|
|
22956
|
+
}
|
|
22957
|
+
static fromBase64(b64) {
|
|
22958
|
+
return new _OrderId(_OrderId.assertLength(base64ToBytes(b64), `base64 "${b64}"`));
|
|
22959
|
+
}
|
|
22960
|
+
static fromBytes(bytes) {
|
|
22961
|
+
return new _OrderId(_OrderId.assertLength(new Uint8Array(bytes), "bytes"));
|
|
22962
|
+
}
|
|
22963
|
+
static assertLength(bytes, source) {
|
|
22964
|
+
if (bytes.length !== ORDER_ID_LENGTH) {
|
|
22965
|
+
throw new Error(
|
|
22966
|
+
`OrderId: expected ${ORDER_ID_LENGTH} bytes (chain layout), got ${bytes.length} from ${source}`
|
|
22967
|
+
);
|
|
22968
|
+
}
|
|
22969
|
+
return bytes;
|
|
22970
|
+
}
|
|
22971
|
+
equals(other) {
|
|
22972
|
+
return this.equalsBytes(other);
|
|
22973
|
+
}
|
|
22974
|
+
};
|
|
22975
|
+
|
|
22976
|
+
// src/core/clob-responses.ts
|
|
22977
|
+
async function withWaitDecode(wait, run, decode) {
|
|
22978
|
+
const w = wait ?? false;
|
|
22979
|
+
const res = await run(w);
|
|
22980
|
+
return w ? decode(res.msgResponses, res) : res;
|
|
22981
|
+
}
|
|
22982
|
+
var LIMIT_RESPONSE_TYPE = "/ault.clob.v1.MsgPlaceLimitOrderResponse";
|
|
22983
|
+
var MARKET_RESPONSE_TYPE = "/ault.clob.v1.MsgPlaceMarketOrderResponse";
|
|
22984
|
+
var SCALE_RESPONSE_TYPE = "/ault.clob.v1.MsgPlaceScaleOrderResponse";
|
|
22985
|
+
var CANCEL_RESPONSE_TYPE = "/ault.clob.v1.MsgCancelOrdersResponse";
|
|
22986
|
+
function findResponse(msgResponses, typeUrl, txHash) {
|
|
22987
|
+
const match = msgResponses?.find((r) => r.typeUrl === typeUrl);
|
|
22988
|
+
if (!match) {
|
|
22989
|
+
throw new MissingMsgResponseError(typeUrl, txHash);
|
|
22990
|
+
}
|
|
22991
|
+
return match.value;
|
|
22992
|
+
}
|
|
22993
|
+
function coinOrUndefined(coin) {
|
|
22994
|
+
return coin && coin.denom !== "" ? coin : void 0;
|
|
22995
|
+
}
|
|
22996
|
+
function decodeLimitOrderResult(msgResponses, base) {
|
|
22997
|
+
const decoded = MsgPlaceLimitOrderResponse.decode(
|
|
22998
|
+
findResponse(msgResponses, LIMIT_RESPONSE_TYPE, base.txHash)
|
|
22999
|
+
);
|
|
23000
|
+
return {
|
|
23001
|
+
...base,
|
|
23002
|
+
orderId: OrderId.fromBytes(decoded.orderId).toHex(),
|
|
23003
|
+
...coinOrUndefined(decoded.escrowedAmount) && { escrowedAmount: decoded.escrowedAmount }
|
|
23004
|
+
};
|
|
23005
|
+
}
|
|
23006
|
+
function decodeMarketOrderResult(msgResponses, base) {
|
|
23007
|
+
const decoded = MsgPlaceMarketOrderResponse.decode(
|
|
23008
|
+
findResponse(msgResponses, MARKET_RESPONSE_TYPE, base.txHash)
|
|
23009
|
+
);
|
|
23010
|
+
return {
|
|
23011
|
+
...base,
|
|
23012
|
+
orderId: OrderId.fromBytes(decoded.orderId).toHex(),
|
|
23013
|
+
...coinOrUndefined(decoded.escrowedAmount) && { escrowedAmount: decoded.escrowedAmount }
|
|
23014
|
+
};
|
|
22265
23015
|
}
|
|
22266
|
-
function
|
|
22267
|
-
|
|
22268
|
-
|
|
22269
|
-
|
|
22270
|
-
|
|
22271
|
-
|
|
22272
|
-
|
|
22273
|
-
|
|
22274
|
-
|
|
22275
|
-
|
|
22276
|
-
},
|
|
22277
|
-
...
|
|
22278
|
-
}
|
|
23016
|
+
function decodeScaleOrderResult(msgResponses, base) {
|
|
23017
|
+
const decoded = MsgPlaceScaleOrderResponse.decode(
|
|
23018
|
+
findResponse(msgResponses, SCALE_RESPONSE_TYPE, base.txHash)
|
|
23019
|
+
);
|
|
23020
|
+
return {
|
|
23021
|
+
...base,
|
|
23022
|
+
orders: decoded.orders.map((o) => ({
|
|
23023
|
+
orderId: OrderId.fromBytes(o.orderId).toHex(),
|
|
23024
|
+
price: o.price,
|
|
23025
|
+
quantity: o.quantity
|
|
23026
|
+
})),
|
|
23027
|
+
...coinOrUndefined(decoded.escrowedAmount) && { escrowedAmount: decoded.escrowedAmount }
|
|
23028
|
+
};
|
|
22279
23029
|
}
|
|
22280
|
-
function
|
|
22281
|
-
|
|
23030
|
+
function decodeCancelOrdersResult(msgResponses, base) {
|
|
23031
|
+
const decoded = MsgCancelOrdersResponse.decode(
|
|
23032
|
+
findResponse(msgResponses, CANCEL_RESPONSE_TYPE, base.txHash)
|
|
23033
|
+
);
|
|
23034
|
+
return {
|
|
23035
|
+
...base,
|
|
23036
|
+
succeeded: decoded.succeeded.map((id) => OrderId.fromBytes(id).toHex()),
|
|
23037
|
+
failed: decoded.failed.map((id) => OrderId.fromBytes(id).toHex())
|
|
23038
|
+
};
|
|
22282
23039
|
}
|
|
22283
|
-
|
|
22284
|
-
|
|
22285
|
-
|
|
22286
|
-
|
|
22287
|
-
|
|
22288
|
-
|
|
22289
|
-
|
|
22290
|
-
|
|
22291
|
-
|
|
22292
|
-
|
|
22293
|
-
|
|
22294
|
-
|
|
22295
|
-
|
|
22296
|
-
|
|
22297
|
-
|
|
22298
|
-
|
|
23040
|
+
|
|
23041
|
+
// src/core/clob-gas.ts
|
|
23042
|
+
function limitOrderGas(gas) {
|
|
23043
|
+
return computeFeeFreeGas(gas.LIMIT_ORDER, 1, gas.FEE_FREE_GAS_MULTIPLIER);
|
|
23044
|
+
}
|
|
23045
|
+
function marketOrderGas(gas) {
|
|
23046
|
+
return computeFeeFreeGas(gas.MARKET_ORDER, 1, gas.FEE_FREE_GAS_MULTIPLIER);
|
|
23047
|
+
}
|
|
23048
|
+
function scaleOrderGas(gas, subOrderCount) {
|
|
23049
|
+
return computeFeeFreeGasCompound(
|
|
23050
|
+
gas.SCALE_ORDER_BASE,
|
|
23051
|
+
gas.SCALE_ORDER_PER_SUB,
|
|
23052
|
+
subOrderCount,
|
|
23053
|
+
gas.FEE_FREE_GAS_MULTIPLIER
|
|
23054
|
+
);
|
|
23055
|
+
}
|
|
23056
|
+
function cancelOrdersGas(gas, orderCount, includeAnte) {
|
|
23057
|
+
const feeFree = computeFeeFreeGasCompound(
|
|
23058
|
+
gas.CANCEL_ORDER_BASE,
|
|
23059
|
+
gas.CANCEL_ORDER_PER_ID,
|
|
23060
|
+
orderCount,
|
|
23061
|
+
gas.FEE_FREE_GAS_MULTIPLIER
|
|
23062
|
+
);
|
|
23063
|
+
if (!includeAnte) return feeFree;
|
|
23064
|
+
return (BigInt(feeFree) + BigInt(gas.EIP712_ANTE_GAS)).toString();
|
|
22299
23065
|
}
|
|
22300
23066
|
|
|
22301
23067
|
// src/high-level/tx/clob.ts
|
|
22302
23068
|
function createClobTxApi({ signerAddress, exec, getGas }) {
|
|
22303
|
-
|
|
22304
|
-
async placeLimitOrder({
|
|
23069
|
+
const api = {
|
|
23070
|
+
async placeLimitOrder({
|
|
23071
|
+
wait,
|
|
23072
|
+
gasLimit,
|
|
23073
|
+
feeAmount,
|
|
23074
|
+
memo,
|
|
23075
|
+
confirmationTimeoutMs,
|
|
23076
|
+
...params
|
|
23077
|
+
}) {
|
|
22305
23078
|
const gas = getGas();
|
|
22306
|
-
return
|
|
22307
|
-
|
|
22308
|
-
|
|
22309
|
-
|
|
22310
|
-
|
|
22311
|
-
|
|
23079
|
+
return withWaitDecode(
|
|
23080
|
+
wait,
|
|
23081
|
+
(w) => exec([buildLimitOrderMsg(signerAddress, params)], {
|
|
23082
|
+
gasLimit: gasLimit ?? limitOrderGas(gas),
|
|
23083
|
+
feeAmount,
|
|
23084
|
+
memo,
|
|
23085
|
+
confirmationTimeoutMs,
|
|
23086
|
+
wait: w
|
|
23087
|
+
}),
|
|
23088
|
+
decodeLimitOrderResult
|
|
23089
|
+
);
|
|
22312
23090
|
},
|
|
22313
|
-
async placeMarketOrder({
|
|
23091
|
+
async placeMarketOrder({
|
|
23092
|
+
wait,
|
|
23093
|
+
gasLimit,
|
|
23094
|
+
feeAmount,
|
|
23095
|
+
memo,
|
|
23096
|
+
confirmationTimeoutMs,
|
|
23097
|
+
...params
|
|
23098
|
+
}) {
|
|
22314
23099
|
const gas = getGas();
|
|
22315
|
-
return
|
|
22316
|
-
|
|
22317
|
-
|
|
22318
|
-
|
|
22319
|
-
|
|
22320
|
-
|
|
23100
|
+
return withWaitDecode(
|
|
23101
|
+
wait,
|
|
23102
|
+
(w) => exec([buildMarketOrderMsg(signerAddress, params)], {
|
|
23103
|
+
gasLimit: gasLimit ?? marketOrderGas(gas),
|
|
23104
|
+
feeAmount,
|
|
23105
|
+
memo,
|
|
23106
|
+
confirmationTimeoutMs,
|
|
23107
|
+
wait: w
|
|
23108
|
+
}),
|
|
23109
|
+
decodeMarketOrderResult
|
|
23110
|
+
);
|
|
22321
23111
|
},
|
|
22322
|
-
async cancelOrders({
|
|
23112
|
+
async cancelOrders({
|
|
23113
|
+
orderIds,
|
|
23114
|
+
wait,
|
|
23115
|
+
gasLimit,
|
|
23116
|
+
feeAmount,
|
|
23117
|
+
memo,
|
|
23118
|
+
confirmationTimeoutMs
|
|
23119
|
+
}) {
|
|
22323
23120
|
const gas = getGas();
|
|
22324
|
-
const cancelGas = gasLimit ?? (
|
|
22325
|
-
|
|
22326
|
-
|
|
22327
|
-
|
|
22328
|
-
|
|
22329
|
-
|
|
22330
|
-
|
|
22331
|
-
|
|
22332
|
-
|
|
22333
|
-
|
|
22334
|
-
|
|
22335
|
-
|
|
22336
|
-
confirmationTimeoutMs
|
|
22337
|
-
});
|
|
23121
|
+
const cancelGas = gasLimit ?? cancelOrdersGas(gas, orderIds.length, true);
|
|
23122
|
+
return withWaitDecode(
|
|
23123
|
+
wait,
|
|
23124
|
+
(w) => exec([buildCancelOrdersMsg(signerAddress, orderIds)], {
|
|
23125
|
+
gasLimit: cancelGas,
|
|
23126
|
+
feeAmount,
|
|
23127
|
+
memo,
|
|
23128
|
+
confirmationTimeoutMs,
|
|
23129
|
+
wait: w
|
|
23130
|
+
}),
|
|
23131
|
+
decodeCancelOrdersResult
|
|
23132
|
+
);
|
|
22338
23133
|
},
|
|
22339
|
-
async placeScaleOrder({
|
|
23134
|
+
async placeScaleOrder({
|
|
23135
|
+
wait,
|
|
23136
|
+
gasLimit,
|
|
23137
|
+
feeAmount,
|
|
23138
|
+
memo,
|
|
23139
|
+
confirmationTimeoutMs,
|
|
23140
|
+
...params
|
|
23141
|
+
}) {
|
|
22340
23142
|
const gas = getGas();
|
|
22341
|
-
return
|
|
22342
|
-
|
|
22343
|
-
|
|
22344
|
-
gas.
|
|
22345
|
-
|
|
22346
|
-
|
|
22347
|
-
|
|
22348
|
-
|
|
22349
|
-
|
|
22350
|
-
|
|
22351
|
-
|
|
23143
|
+
return withWaitDecode(
|
|
23144
|
+
wait,
|
|
23145
|
+
(w) => exec([buildScaleOrderMsg(signerAddress, params)], {
|
|
23146
|
+
gasLimit: gasLimit ?? scaleOrderGas(gas, params.weights.length),
|
|
23147
|
+
feeAmount,
|
|
23148
|
+
memo,
|
|
23149
|
+
confirmationTimeoutMs,
|
|
23150
|
+
wait: w
|
|
23151
|
+
}),
|
|
23152
|
+
decodeScaleOrderResult
|
|
23153
|
+
);
|
|
22352
23154
|
},
|
|
22353
|
-
async updateClobParams({
|
|
23155
|
+
async updateClobParams({
|
|
23156
|
+
params,
|
|
23157
|
+
gasLimit,
|
|
23158
|
+
feeAmount,
|
|
23159
|
+
memo,
|
|
23160
|
+
confirmationTimeoutMs
|
|
23161
|
+
}) {
|
|
22354
23162
|
return exec([msg.clob.updateParams({ authority: signerAddress, params })], {
|
|
22355
23163
|
gasLimit,
|
|
22356
23164
|
feeAmount,
|
|
@@ -22359,6 +23167,7 @@ function createClobTxApi({ signerAddress, exec, getGas }) {
|
|
|
22359
23167
|
});
|
|
22360
23168
|
}
|
|
22361
23169
|
};
|
|
23170
|
+
return api;
|
|
22362
23171
|
}
|
|
22363
23172
|
|
|
22364
23173
|
// src/high-level/tx/license.ts
|
|
@@ -23187,9 +23996,9 @@ function createStakingTxApi({ signerAddress, exec, getGas }) {
|
|
|
23187
23996
|
}
|
|
23188
23997
|
|
|
23189
23998
|
// src/high-level/tx/tokenregistry.ts
|
|
23190
|
-
var
|
|
23999
|
+
var import_viem5 = require("viem");
|
|
23191
24000
|
function normalizeErc20Address(address) {
|
|
23192
|
-
return (0,
|
|
24001
|
+
return (0, import_viem5.getAddress)(address);
|
|
23193
24002
|
}
|
|
23194
24003
|
function createTokenRegistryTxApi({
|
|
23195
24004
|
signerAddress,
|
|
@@ -23264,6 +24073,43 @@ function createTokenRegistryTxApi({
|
|
|
23264
24073
|
};
|
|
23265
24074
|
}
|
|
23266
24075
|
|
|
24076
|
+
// src/proto/tx-decode.ts
|
|
24077
|
+
var import_wire46 = require("@bufbuild/protobuf/wire");
|
|
24078
|
+
function decodeTxMsgResponses(dataHex) {
|
|
24079
|
+
if (!dataHex) return [];
|
|
24080
|
+
const bytes = hexToBytes2(dataHex);
|
|
24081
|
+
if (bytes.length === 0) return [];
|
|
24082
|
+
const reader = new import_wire46.BinaryReader(bytes);
|
|
24083
|
+
const responses = [];
|
|
24084
|
+
while (reader.pos < reader.len) {
|
|
24085
|
+
const tag = reader.uint32();
|
|
24086
|
+
if (tag === 18) {
|
|
24087
|
+
const any = Any.decode(reader, reader.uint32());
|
|
24088
|
+
responses.push({ typeUrl: any.typeUrl, value: any.value });
|
|
24089
|
+
continue;
|
|
24090
|
+
}
|
|
24091
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
24092
|
+
break;
|
|
24093
|
+
}
|
|
24094
|
+
reader.skip(tag & 7);
|
|
24095
|
+
}
|
|
24096
|
+
return responses;
|
|
24097
|
+
}
|
|
24098
|
+
function hexToBytes2(hex) {
|
|
24099
|
+
const clean = hex.startsWith("0x") || hex.startsWith("0X") ? hex.slice(2) : hex;
|
|
24100
|
+
if (clean.length % 2 !== 0) {
|
|
24101
|
+
throw new Error(`decodeTxMsgResponses: invalid hex length in tx_response.data`);
|
|
24102
|
+
}
|
|
24103
|
+
if (!/^[0-9a-fA-F]*$/.test(clean)) {
|
|
24104
|
+
throw new Error(`decodeTxMsgResponses: invalid hex character in tx_response.data`);
|
|
24105
|
+
}
|
|
24106
|
+
const out = new Uint8Array(clean.length / 2);
|
|
24107
|
+
for (let i = 0; i < out.length; i++) {
|
|
24108
|
+
out[i] = Number.parseInt(clean.slice(i * 2, i * 2 + 2), 16);
|
|
24109
|
+
}
|
|
24110
|
+
return out;
|
|
24111
|
+
}
|
|
24112
|
+
|
|
23267
24113
|
// src/high-level/tx-executor.ts
|
|
23268
24114
|
function createTxExecutor(options) {
|
|
23269
24115
|
const defaultMemo = options.defaultMemo ?? "";
|
|
@@ -23288,17 +24134,20 @@ function createTxExecutor(options) {
|
|
|
23288
24134
|
feeAmount: txOptions?.feeAmount,
|
|
23289
24135
|
memo: txOptions?.memo ?? defaultMemo,
|
|
23290
24136
|
confirmationTimeoutMs: txOptions?.confirmationTimeoutMs ?? defaultConfirmationTimeoutMs,
|
|
24137
|
+
wait: txOptions?.wait ?? true,
|
|
23291
24138
|
fetchFn: options.fetchFn,
|
|
23292
24139
|
fetchOptions,
|
|
23293
24140
|
cache,
|
|
23294
24141
|
feeMarketCache
|
|
23295
24142
|
});
|
|
24143
|
+
const msgResponses = result.data ? decodeTxMsgResponses(result.data) : void 0;
|
|
23296
24144
|
return {
|
|
23297
24145
|
txHash: result.txHash,
|
|
23298
|
-
code:
|
|
24146
|
+
code: result.code,
|
|
23299
24147
|
rawLog: result.rawLog,
|
|
23300
|
-
confirmed:
|
|
23301
|
-
success: true
|
|
24148
|
+
confirmed: result.confirmed,
|
|
24149
|
+
success: result.confirmed === true && result.code === 0,
|
|
24150
|
+
...msgResponses && { msgResponses }
|
|
23302
24151
|
};
|
|
23303
24152
|
};
|
|
23304
24153
|
}
|
|
@@ -23531,12 +24380,12 @@ function createStaticResolver(optsOrNetwork, legacyManifest) {
|
|
|
23531
24380
|
|
|
23532
24381
|
// src/agent/attach.ts
|
|
23533
24382
|
var import_secp256k12 = require("@noble/curves/secp256k1");
|
|
23534
|
-
var
|
|
24383
|
+
var import_viem7 = require("viem");
|
|
23535
24384
|
var import_encoding3 = require("@cosmjs/encoding");
|
|
23536
24385
|
|
|
23537
24386
|
// src/agent/sign-and-broadcast.ts
|
|
23538
24387
|
var import_secp256k1 = require("@noble/curves/secp256k1");
|
|
23539
|
-
var
|
|
24388
|
+
var import_viem6 = require("viem");
|
|
23540
24389
|
var AGENT_DEFAULTS = {
|
|
23541
24390
|
GAS_LIMIT: "147600",
|
|
23542
24391
|
TIMEOUT_SECONDS: 300,
|
|
@@ -23545,7 +24394,7 @@ var AGENT_DEFAULTS = {
|
|
|
23545
24394
|
};
|
|
23546
24395
|
function computeAgentKeyMaterial(agentPrivateKey) {
|
|
23547
24396
|
const normalized = agentPrivateKey.startsWith("0x") ? agentPrivateKey : `0x${agentPrivateKey}`;
|
|
23548
|
-
const privKeyBytes = (0,
|
|
24397
|
+
const privKeyBytes = (0, import_viem6.hexToBytes)(normalized);
|
|
23549
24398
|
const compressedPubkey = import_secp256k1.secp256k1.getPublicKey(privKeyBytes, true);
|
|
23550
24399
|
return { privKeyBytes, compressedPubkey };
|
|
23551
24400
|
}
|
|
@@ -23565,6 +24414,7 @@ async function signAndBroadcastAgentTx({
|
|
|
23565
24414
|
memo = "",
|
|
23566
24415
|
gasLimit,
|
|
23567
24416
|
confirmationTimeoutMs,
|
|
24417
|
+
wait = true,
|
|
23568
24418
|
timeoutSeconds,
|
|
23569
24419
|
timeoutTimestamp,
|
|
23570
24420
|
fetchFn,
|
|
@@ -23625,7 +24475,7 @@ async function signAndBroadcastAgentTx({
|
|
|
23625
24475
|
chainId: network.chainId,
|
|
23626
24476
|
accountNumber: BigInt(accountNumber)
|
|
23627
24477
|
});
|
|
23628
|
-
const hash = (0,
|
|
24478
|
+
const hash = (0, import_viem6.hexToBytes)((0, import_viem6.keccak256)(signDocBytes));
|
|
23629
24479
|
const sig = import_secp256k1.secp256k1.sign(hash, privKeyBytes);
|
|
23630
24480
|
const signatureBytes = sig.toCompactRawBytes();
|
|
23631
24481
|
const txRawBytes = encodeTxRaw({
|
|
@@ -23649,6 +24499,14 @@ async function signAndBroadcastAgentTx({
|
|
|
23649
24499
|
confirmed: true
|
|
23650
24500
|
});
|
|
23651
24501
|
}
|
|
24502
|
+
if (!wait) {
|
|
24503
|
+
return {
|
|
24504
|
+
txHash,
|
|
24505
|
+
code: 0,
|
|
24506
|
+
rawLog: result.tx_response.raw_log,
|
|
24507
|
+
confirmed: false
|
|
24508
|
+
};
|
|
24509
|
+
}
|
|
23652
24510
|
const deliverResult = await pollTxInclusion(
|
|
23653
24511
|
network,
|
|
23654
24512
|
txHash,
|
|
@@ -23684,6 +24542,7 @@ async function signAndBroadcastAgentTx({
|
|
|
23684
24542
|
txHash,
|
|
23685
24543
|
code: 0,
|
|
23686
24544
|
rawLog: deliverResult.rawLog,
|
|
24545
|
+
data: deliverResult.data,
|
|
23687
24546
|
confirmed: true
|
|
23688
24547
|
};
|
|
23689
24548
|
}
|
|
@@ -23710,17 +24569,20 @@ function createAgentTxExecutor(options) {
|
|
|
23710
24569
|
gasLimit: txOptions?.gasLimit ?? defaultGasLimit,
|
|
23711
24570
|
memo: txOptions?.memo ?? defaultMemo,
|
|
23712
24571
|
confirmationTimeoutMs: txOptions?.confirmationTimeoutMs ?? defaultConfirmationTimeoutMs,
|
|
24572
|
+
wait: txOptions?.wait ?? true,
|
|
23713
24573
|
timeoutSeconds: txOptions?.timeoutSeconds ?? defaultTimeoutSeconds,
|
|
23714
24574
|
fetchFn: options.fetchFn,
|
|
23715
24575
|
fetchOptions,
|
|
23716
24576
|
cache
|
|
23717
24577
|
});
|
|
24578
|
+
const msgResponses = result.data ? decodeTxMsgResponses(result.data) : void 0;
|
|
23718
24579
|
return {
|
|
23719
24580
|
txHash: result.txHash,
|
|
23720
|
-
code:
|
|
24581
|
+
code: result.code,
|
|
23721
24582
|
rawLog: result.rawLog,
|
|
23722
|
-
confirmed:
|
|
23723
|
-
success: true
|
|
24583
|
+
confirmed: result.confirmed,
|
|
24584
|
+
success: result.confirmed === true && result.code === 0,
|
|
24585
|
+
...msgResponses && { msgResponses }
|
|
23724
24586
|
};
|
|
23725
24587
|
};
|
|
23726
24588
|
}
|
|
@@ -23731,63 +24593,103 @@ function createAgentClobTxApi({
|
|
|
23731
24593
|
exec,
|
|
23732
24594
|
getGas
|
|
23733
24595
|
}) {
|
|
23734
|
-
|
|
23735
|
-
async placeLimitOrder({
|
|
24596
|
+
const api = {
|
|
24597
|
+
async placeLimitOrder({
|
|
24598
|
+
wait,
|
|
24599
|
+
gasLimit,
|
|
24600
|
+
memo,
|
|
24601
|
+
confirmationTimeoutMs,
|
|
24602
|
+
timeoutSeconds,
|
|
24603
|
+
...params
|
|
24604
|
+
}) {
|
|
23736
24605
|
const gas = getGas();
|
|
23737
|
-
return
|
|
23738
|
-
|
|
23739
|
-
|
|
23740
|
-
|
|
23741
|
-
|
|
23742
|
-
|
|
24606
|
+
return withWaitDecode(
|
|
24607
|
+
wait,
|
|
24608
|
+
(w) => exec([buildLimitOrderMsg(masterAddress, params)], {
|
|
24609
|
+
gasLimit: gasLimit ?? limitOrderGas(gas),
|
|
24610
|
+
memo,
|
|
24611
|
+
confirmationTimeoutMs,
|
|
24612
|
+
timeoutSeconds,
|
|
24613
|
+
wait: w
|
|
24614
|
+
}),
|
|
24615
|
+
decodeLimitOrderResult
|
|
24616
|
+
);
|
|
23743
24617
|
},
|
|
23744
|
-
async placeMarketOrder({
|
|
24618
|
+
async placeMarketOrder({
|
|
24619
|
+
wait,
|
|
24620
|
+
gasLimit,
|
|
24621
|
+
memo,
|
|
24622
|
+
confirmationTimeoutMs,
|
|
24623
|
+
timeoutSeconds,
|
|
24624
|
+
...params
|
|
24625
|
+
}) {
|
|
23745
24626
|
const gas = getGas();
|
|
23746
|
-
return
|
|
23747
|
-
|
|
23748
|
-
|
|
23749
|
-
|
|
23750
|
-
|
|
23751
|
-
|
|
24627
|
+
return withWaitDecode(
|
|
24628
|
+
wait,
|
|
24629
|
+
(w) => exec([buildMarketOrderMsg(masterAddress, params)], {
|
|
24630
|
+
gasLimit: gasLimit ?? marketOrderGas(gas),
|
|
24631
|
+
memo,
|
|
24632
|
+
confirmationTimeoutMs,
|
|
24633
|
+
timeoutSeconds,
|
|
24634
|
+
wait: w
|
|
24635
|
+
}),
|
|
24636
|
+
decodeMarketOrderResult
|
|
24637
|
+
);
|
|
23752
24638
|
},
|
|
23753
|
-
async cancelOrders({
|
|
24639
|
+
async cancelOrders({
|
|
24640
|
+
orderIds,
|
|
24641
|
+
wait,
|
|
24642
|
+
gasLimit,
|
|
24643
|
+
memo,
|
|
24644
|
+
confirmationTimeoutMs,
|
|
24645
|
+
timeoutSeconds
|
|
24646
|
+
}) {
|
|
23754
24647
|
const gas = getGas();
|
|
23755
|
-
return
|
|
23756
|
-
|
|
23757
|
-
|
|
23758
|
-
gas.
|
|
23759
|
-
orderIds.length,
|
|
23760
|
-
|
|
23761
|
-
|
|
23762
|
-
|
|
23763
|
-
|
|
23764
|
-
|
|
23765
|
-
|
|
24648
|
+
return withWaitDecode(
|
|
24649
|
+
wait,
|
|
24650
|
+
(w) => exec([buildCancelOrdersMsg(masterAddress, orderIds)], {
|
|
24651
|
+
// Agent cancels are gas-capped: no EIP-712 ante (includeAnte: false).
|
|
24652
|
+
gasLimit: gasLimit ?? cancelOrdersGas(gas, orderIds.length, false),
|
|
24653
|
+
memo,
|
|
24654
|
+
confirmationTimeoutMs,
|
|
24655
|
+
timeoutSeconds,
|
|
24656
|
+
wait: w
|
|
24657
|
+
}),
|
|
24658
|
+
decodeCancelOrdersResult
|
|
24659
|
+
);
|
|
23766
24660
|
},
|
|
23767
|
-
async placeScaleOrder({
|
|
24661
|
+
async placeScaleOrder({
|
|
24662
|
+
wait,
|
|
24663
|
+
gasLimit,
|
|
24664
|
+
memo,
|
|
24665
|
+
confirmationTimeoutMs,
|
|
24666
|
+
timeoutSeconds,
|
|
24667
|
+
...params
|
|
24668
|
+
}) {
|
|
23768
24669
|
const gas = getGas();
|
|
23769
|
-
return
|
|
23770
|
-
|
|
23771
|
-
|
|
23772
|
-
gas.
|
|
23773
|
-
|
|
23774
|
-
|
|
23775
|
-
|
|
23776
|
-
|
|
23777
|
-
|
|
23778
|
-
|
|
23779
|
-
|
|
24670
|
+
return withWaitDecode(
|
|
24671
|
+
wait,
|
|
24672
|
+
(w) => exec([buildScaleOrderMsg(masterAddress, params)], {
|
|
24673
|
+
gasLimit: gasLimit ?? scaleOrderGas(gas, params.weights.length),
|
|
24674
|
+
memo,
|
|
24675
|
+
confirmationTimeoutMs,
|
|
24676
|
+
timeoutSeconds,
|
|
24677
|
+
wait: w
|
|
24678
|
+
}),
|
|
24679
|
+
decodeScaleOrderResult
|
|
24680
|
+
);
|
|
23780
24681
|
}
|
|
23781
24682
|
};
|
|
24683
|
+
return api;
|
|
23782
24684
|
}
|
|
23783
24685
|
|
|
23784
24686
|
// src/agent/attach.ts
|
|
23785
24687
|
function deriveAgentAddress(privateKeyHex) {
|
|
23786
|
-
const privKeyBytes = (0,
|
|
24688
|
+
const privKeyBytes = (0, import_viem7.hexToBytes)(
|
|
23787
24689
|
privateKeyHex.startsWith("0x") ? privateKeyHex : `0x${privateKeyHex}`
|
|
23788
24690
|
);
|
|
23789
24691
|
const uncompressedPubkey = import_secp256k12.secp256k1.getPublicKey(privKeyBytes, false);
|
|
23790
|
-
const pubkeyHash = (0,
|
|
24692
|
+
const pubkeyHash = (0, import_viem7.hexToBytes)((0, import_viem7.keccak256)(uncompressedPubkey.slice(1)));
|
|
23791
24693
|
const evmAddressBytes = pubkeyHash.slice(12);
|
|
23792
24694
|
const evmHex = `0x${(0, import_encoding3.toHex)(evmAddressBytes)}`;
|
|
23793
24695
|
return evmToAult(evmHex);
|
|
@@ -23918,92 +24820,6 @@ async function buildClient(options, resolver) {
|
|
|
23918
24820
|
return client;
|
|
23919
24821
|
}
|
|
23920
24822
|
|
|
23921
|
-
// src/utils/opaque-id.ts
|
|
23922
|
-
var import_viem7 = require("viem");
|
|
23923
|
-
function decodeHex(input) {
|
|
23924
|
-
const clean = input.startsWith("0x") || input.startsWith("0X") ? input.slice(2) : input;
|
|
23925
|
-
if (clean.length % 2 !== 0) {
|
|
23926
|
-
throw new Error(`invalid hex length: "${input}"`);
|
|
23927
|
-
}
|
|
23928
|
-
if (clean.length > 0 && !/^[0-9a-fA-F]+$/.test(clean)) {
|
|
23929
|
-
throw new Error(`invalid hex characters: "${input}"`);
|
|
23930
|
-
}
|
|
23931
|
-
return (0, import_viem7.hexToBytes)(`0x${clean}`);
|
|
23932
|
-
}
|
|
23933
|
-
function encodeHex(bytes) {
|
|
23934
|
-
return (0, import_viem7.bytesToHex)(bytes).slice(2);
|
|
23935
|
-
}
|
|
23936
|
-
function bytesEqual(a, b) {
|
|
23937
|
-
if (a.length !== b.length) return false;
|
|
23938
|
-
for (let i = 0; i < a.length; i++) {
|
|
23939
|
-
if (a[i] !== b[i]) return false;
|
|
23940
|
-
}
|
|
23941
|
-
return true;
|
|
23942
|
-
}
|
|
23943
|
-
var OpaqueId = class {
|
|
23944
|
-
constructor(bytes) {
|
|
23945
|
-
this.bytes = bytes;
|
|
23946
|
-
}
|
|
23947
|
-
toBytes() {
|
|
23948
|
-
return new Uint8Array(this.bytes);
|
|
23949
|
-
}
|
|
23950
|
-
toHex() {
|
|
23951
|
-
return encodeHex(this.bytes);
|
|
23952
|
-
}
|
|
23953
|
-
toBase64() {
|
|
23954
|
-
return bytesToBase64(this.bytes);
|
|
23955
|
-
}
|
|
23956
|
-
toString() {
|
|
23957
|
-
return this.toHex();
|
|
23958
|
-
}
|
|
23959
|
-
equalsBytes(other) {
|
|
23960
|
-
return bytesEqual(this.bytes, other.bytes);
|
|
23961
|
-
}
|
|
23962
|
-
};
|
|
23963
|
-
var MarketId = class _MarketId extends OpaqueId {
|
|
23964
|
-
static fromHex(hex) {
|
|
23965
|
-
return new _MarketId(_MarketId.assertNonEmpty(decodeHex(hex), `hex "${hex}"`));
|
|
23966
|
-
}
|
|
23967
|
-
static fromBase64(b64) {
|
|
23968
|
-
return new _MarketId(_MarketId.assertNonEmpty(base64ToBytes(b64), `base64 "${b64}"`));
|
|
23969
|
-
}
|
|
23970
|
-
static fromBytes(bytes) {
|
|
23971
|
-
return new _MarketId(_MarketId.assertNonEmpty(new Uint8Array(bytes), "bytes"));
|
|
23972
|
-
}
|
|
23973
|
-
static assertNonEmpty(bytes, source) {
|
|
23974
|
-
if (bytes.length === 0) {
|
|
23975
|
-
throw new Error(`MarketId: empty bytes from ${source}`);
|
|
23976
|
-
}
|
|
23977
|
-
return bytes;
|
|
23978
|
-
}
|
|
23979
|
-
equals(other) {
|
|
23980
|
-
return this.equalsBytes(other);
|
|
23981
|
-
}
|
|
23982
|
-
};
|
|
23983
|
-
var ORDER_ID_LENGTH = 16;
|
|
23984
|
-
var OrderId = class _OrderId extends OpaqueId {
|
|
23985
|
-
static fromHex(hex) {
|
|
23986
|
-
return new _OrderId(_OrderId.assertLength(decodeHex(hex), `hex "${hex}"`));
|
|
23987
|
-
}
|
|
23988
|
-
static fromBase64(b64) {
|
|
23989
|
-
return new _OrderId(_OrderId.assertLength(base64ToBytes(b64), `base64 "${b64}"`));
|
|
23990
|
-
}
|
|
23991
|
-
static fromBytes(bytes) {
|
|
23992
|
-
return new _OrderId(_OrderId.assertLength(new Uint8Array(bytes), "bytes"));
|
|
23993
|
-
}
|
|
23994
|
-
static assertLength(bytes, source) {
|
|
23995
|
-
if (bytes.length !== ORDER_ID_LENGTH) {
|
|
23996
|
-
throw new Error(
|
|
23997
|
-
`OrderId: expected ${ORDER_ID_LENGTH} bytes (chain layout), got ${bytes.length} from ${source}`
|
|
23998
|
-
);
|
|
23999
|
-
}
|
|
24000
|
-
return bytes;
|
|
24001
|
-
}
|
|
24002
|
-
equals(other) {
|
|
24003
|
-
return this.equalsBytes(other);
|
|
24004
|
-
}
|
|
24005
|
-
};
|
|
24006
|
-
|
|
24007
24823
|
// src/rest/types.ts
|
|
24008
24824
|
var import_zod2 = require("zod");
|
|
24009
24825
|
var PageResponseSchema = import_zod2.z.object({
|
|
@@ -24307,22 +25123,22 @@ var GetStatsResponse = zod.object({
|
|
|
24307
25123
|
window: zod.enum(["24h"]),
|
|
24308
25124
|
totals: zod.object({
|
|
24309
25125
|
quoteVolume: zod.string().regex(getStatsResponseTotalsQuoteVolumeRegExp).nullable().describe(
|
|
24310
|
-
"Total quote volume over the window as a canonical decimal string.\nNull when
|
|
25126
|
+
"Total quote volume over the window as a canonical decimal string.\nNull when contributing markets span more than one quote (then\n`estimatedFee` and `quoteAsset` are null too).\n"
|
|
24311
25127
|
),
|
|
24312
25128
|
quoteAsset: zod.string().nullable().describe(
|
|
24313
|
-
'
|
|
25129
|
+
'Shared quote ticker of the markets that had volume. Null when they\nspan more than one quote, or on an idle window (then `quoteVolume`\nis "0"; a null `quoteVolume` means multi-quote).\n'
|
|
24314
25130
|
),
|
|
24315
25131
|
estimatedFee: zod.string().regex(getStatsResponseTotalsEstimatedFeeRegExp).nullable().describe(
|
|
24316
|
-
"Estimated total fees (`\u03A3 quoteVolume \xD7 takerFeeRate`) as a
|
|
25132
|
+
"Estimated total fees (`\u03A3 quoteVolume \xD7 takerFeeRate`) as a decimal\nstring; an estimate, not booked revenue. Null on multi-quote.\n"
|
|
24317
25133
|
),
|
|
24318
25134
|
tradeCount: zod.number().describe("Number of fills (maker legs) in the window."),
|
|
24319
25135
|
traderCount: zod.number().describe("Distinct trading addresses in the window."),
|
|
24320
25136
|
activeMarkets: zod.number().describe("Number of markets with at least one fill in the window."),
|
|
24321
25137
|
dailyActiveUsers: zod.number().nullable().describe(
|
|
24322
|
-
"Distinct trading addresses in the window
|
|
25138
|
+
"Distinct trading addresses in the window. Currently an alias of\n`traderCount`; separate so a precise DAU source can diverge later.\n"
|
|
24323
25139
|
),
|
|
24324
25140
|
averageSlippageBps: zod.string().regex(getStatsResponseTotalsAverageSlippageBpsRegExp).nullable().describe(
|
|
24325
|
-
"Volume-weighted taker slippage (fill vs book-mid) in
|
|
25141
|
+
"Volume-weighted taker slippage (fill vs book-mid) in bps as a\ndecimal string. Null with no benchmarkable taker fill or when\nfills span more than one quote.\n"
|
|
24326
25142
|
),
|
|
24327
25143
|
depositUsdcVolume24h: zod.string().regex(getStatsResponseTotalsDepositUsdcVolume24hRegExp).nullable().describe("Reserved. Currently always null."),
|
|
24328
25144
|
builderCodesFee24h: zod.string().regex(getStatsResponseTotalsBuilderCodesFee24hRegExp).nullable().describe("Reserved. Currently always null.")
|
|
@@ -24718,7 +25534,7 @@ function createDexWs(url, options) {
|
|
|
24718
25534
|
}
|
|
24719
25535
|
|
|
24720
25536
|
// src/index.ts
|
|
24721
|
-
var SDK_VERSION = "0.0.2-alpha.
|
|
25537
|
+
var SDK_VERSION = "0.0.2-alpha.24";
|
|
24722
25538
|
// Annotate the CommonJS export names for ESM import in node:
|
|
24723
25539
|
0 && (module.exports = {
|
|
24724
25540
|
AGENT_DEFAULTS,
|
|
@@ -24789,6 +25605,7 @@ var SDK_VERSION = "0.0.2-alpha.22";
|
|
|
24789
25605
|
ManifestUrlsSchema,
|
|
24790
25606
|
MarketId,
|
|
24791
25607
|
MarketType,
|
|
25608
|
+
MissingMsgResponseError,
|
|
24792
25609
|
NETWORKS,
|
|
24793
25610
|
NetworkError,
|
|
24794
25611
|
OrderId,
|