@qorechain/sdk 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +141 -13
- package/dist/index.cjs +2675 -423
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1623 -195
- package/dist/index.d.ts +1623 -195
- package/dist/index.js +2638 -424
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import { wordlist } from '@scure/bip39/wordlists/english';
|
|
|
14
14
|
import { HDKey as HDKey$1 } from '@scure/bip32';
|
|
15
15
|
import { HDKey } from 'micro-key-producer/slip10.js';
|
|
16
16
|
import { secp256k1 } from '@noble/curves/secp256k1';
|
|
17
|
-
import { mldsa87, shake256 } from '@qorechain/pqc';
|
|
17
|
+
import { mldsa87, shake256, mldsa } from '@qorechain/pqc';
|
|
18
18
|
import { randomBytes } from '@noble/hashes/utils';
|
|
19
19
|
export { AI_ANOMALY_CHECK_ADDRESS, AI_RISK_SCORE_ADDRESS, RISK_LEVEL_UNSAFE_THRESHOLD, ai, aiAnomalyCheck, aiRiskScore, simulateWithRiskScore } from '@qorechain/evm';
|
|
20
20
|
import { connectComet } from '@cosmjs/tendermint-rpc';
|
|
@@ -276,6 +276,35 @@ var RestClient = class {
|
|
|
276
276
|
getInflationRate() {
|
|
277
277
|
return this.get("/qorechain/inflation/v1/rate");
|
|
278
278
|
}
|
|
279
|
+
// --- Abstract-account authenticator lanes (v3.1.85) ----------------------
|
|
280
|
+
/**
|
|
281
|
+
* The canonical authenticator permission taxonomy
|
|
282
|
+
* (`/qorechain/abstractaccount/v1/permission_schema`): the valid permission
|
|
283
|
+
* strings, the message-typeURL→permission mapping, the never-delegable
|
|
284
|
+
* key-management typeURLs, and a `schema_version` for drift detection.
|
|
285
|
+
*/
|
|
286
|
+
getPermissionSchema() {
|
|
287
|
+
return this.get(
|
|
288
|
+
"/qorechain/abstractaccount/v1/permission_schema"
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
/** Abstract-account module config (`/qorechain/abstractaccount/v1/config`). */
|
|
292
|
+
getAbstractAccountConfig() {
|
|
293
|
+
return this.get("/qorechain/abstractaccount/v1/config");
|
|
294
|
+
}
|
|
295
|
+
/** All abstract accounts (`/qorechain/abstractaccount/v1/accounts`). */
|
|
296
|
+
getAbstractAccounts() {
|
|
297
|
+
return this.get("/qorechain/abstractaccount/v1/accounts");
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* A single abstract account by address
|
|
301
|
+
* (`/qorechain/abstractaccount/v1/accounts/{address}`).
|
|
302
|
+
*/
|
|
303
|
+
getAbstractAccount(address) {
|
|
304
|
+
return this.get(
|
|
305
|
+
`/qorechain/abstractaccount/v1/accounts/${encodeURIComponent(address)}`
|
|
306
|
+
);
|
|
307
|
+
}
|
|
279
308
|
};
|
|
280
309
|
|
|
281
310
|
// src/query/jsonrpc.ts
|
|
@@ -5749,6 +5778,8 @@ __export(tx_exports5, {
|
|
|
5749
5778
|
MsgRegisterPQCKeyResponse: () => MsgRegisterPQCKeyResponse,
|
|
5750
5779
|
MsgRegisterPQCKeyV2: () => MsgRegisterPQCKeyV2,
|
|
5751
5780
|
MsgRegisterPQCKeyV2Response: () => MsgRegisterPQCKeyV2Response,
|
|
5781
|
+
MsgRotatePQCKey: () => MsgRotatePQCKey,
|
|
5782
|
+
MsgRotatePQCKeyResponse: () => MsgRotatePQCKeyResponse,
|
|
5752
5783
|
protobufPackage: () => protobufPackage5
|
|
5753
5784
|
});
|
|
5754
5785
|
var protobufPackage5 = "qorechain.pqc.v1";
|
|
@@ -6203,6 +6234,160 @@ var MsgMigratePQCKeyResponse = {
|
|
|
6203
6234
|
return message;
|
|
6204
6235
|
}
|
|
6205
6236
|
};
|
|
6237
|
+
function createBaseMsgRotatePQCKey() {
|
|
6238
|
+
return {
|
|
6239
|
+
sender: "",
|
|
6240
|
+
oldPublicKey: new Uint8Array(0),
|
|
6241
|
+
newPublicKey: new Uint8Array(0),
|
|
6242
|
+
oldSignature: new Uint8Array(0),
|
|
6243
|
+
newSignature: new Uint8Array(0)
|
|
6244
|
+
};
|
|
6245
|
+
}
|
|
6246
|
+
var MsgRotatePQCKey = {
|
|
6247
|
+
encode(message, writer = new BinaryWriter()) {
|
|
6248
|
+
if (message.sender !== "") {
|
|
6249
|
+
writer.uint32(10).string(message.sender);
|
|
6250
|
+
}
|
|
6251
|
+
if (message.oldPublicKey.length !== 0) {
|
|
6252
|
+
writer.uint32(18).bytes(message.oldPublicKey);
|
|
6253
|
+
}
|
|
6254
|
+
if (message.newPublicKey.length !== 0) {
|
|
6255
|
+
writer.uint32(26).bytes(message.newPublicKey);
|
|
6256
|
+
}
|
|
6257
|
+
if (message.oldSignature.length !== 0) {
|
|
6258
|
+
writer.uint32(34).bytes(message.oldSignature);
|
|
6259
|
+
}
|
|
6260
|
+
if (message.newSignature.length !== 0) {
|
|
6261
|
+
writer.uint32(42).bytes(message.newSignature);
|
|
6262
|
+
}
|
|
6263
|
+
return writer;
|
|
6264
|
+
},
|
|
6265
|
+
decode(input, length) {
|
|
6266
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
6267
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
6268
|
+
const message = createBaseMsgRotatePQCKey();
|
|
6269
|
+
while (reader.pos < end) {
|
|
6270
|
+
const tag = reader.uint32();
|
|
6271
|
+
switch (tag >>> 3) {
|
|
6272
|
+
case 1: {
|
|
6273
|
+
if (tag !== 10) {
|
|
6274
|
+
break;
|
|
6275
|
+
}
|
|
6276
|
+
message.sender = reader.string();
|
|
6277
|
+
continue;
|
|
6278
|
+
}
|
|
6279
|
+
case 2: {
|
|
6280
|
+
if (tag !== 18) {
|
|
6281
|
+
break;
|
|
6282
|
+
}
|
|
6283
|
+
message.oldPublicKey = reader.bytes();
|
|
6284
|
+
continue;
|
|
6285
|
+
}
|
|
6286
|
+
case 3: {
|
|
6287
|
+
if (tag !== 26) {
|
|
6288
|
+
break;
|
|
6289
|
+
}
|
|
6290
|
+
message.newPublicKey = reader.bytes();
|
|
6291
|
+
continue;
|
|
6292
|
+
}
|
|
6293
|
+
case 4: {
|
|
6294
|
+
if (tag !== 34) {
|
|
6295
|
+
break;
|
|
6296
|
+
}
|
|
6297
|
+
message.oldSignature = reader.bytes();
|
|
6298
|
+
continue;
|
|
6299
|
+
}
|
|
6300
|
+
case 5: {
|
|
6301
|
+
if (tag !== 42) {
|
|
6302
|
+
break;
|
|
6303
|
+
}
|
|
6304
|
+
message.newSignature = reader.bytes();
|
|
6305
|
+
continue;
|
|
6306
|
+
}
|
|
6307
|
+
}
|
|
6308
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
6309
|
+
break;
|
|
6310
|
+
}
|
|
6311
|
+
reader.skip(tag & 7);
|
|
6312
|
+
}
|
|
6313
|
+
return message;
|
|
6314
|
+
},
|
|
6315
|
+
fromJSON(object) {
|
|
6316
|
+
return {
|
|
6317
|
+
sender: isSet6(object.sender) ? globalThis.String(object.sender) : "",
|
|
6318
|
+
oldPublicKey: isSet6(object.oldPublicKey) ? bytesFromBase644(object.oldPublicKey) : isSet6(object.old_public_key) ? bytesFromBase644(object.old_public_key) : new Uint8Array(0),
|
|
6319
|
+
newPublicKey: isSet6(object.newPublicKey) ? bytesFromBase644(object.newPublicKey) : isSet6(object.new_public_key) ? bytesFromBase644(object.new_public_key) : new Uint8Array(0),
|
|
6320
|
+
oldSignature: isSet6(object.oldSignature) ? bytesFromBase644(object.oldSignature) : isSet6(object.old_signature) ? bytesFromBase644(object.old_signature) : new Uint8Array(0),
|
|
6321
|
+
newSignature: isSet6(object.newSignature) ? bytesFromBase644(object.newSignature) : isSet6(object.new_signature) ? bytesFromBase644(object.new_signature) : new Uint8Array(0)
|
|
6322
|
+
};
|
|
6323
|
+
},
|
|
6324
|
+
toJSON(message) {
|
|
6325
|
+
const obj = {};
|
|
6326
|
+
if (message.sender !== "") {
|
|
6327
|
+
obj.sender = message.sender;
|
|
6328
|
+
}
|
|
6329
|
+
if (message.oldPublicKey.length !== 0) {
|
|
6330
|
+
obj.oldPublicKey = base64FromBytes4(message.oldPublicKey);
|
|
6331
|
+
}
|
|
6332
|
+
if (message.newPublicKey.length !== 0) {
|
|
6333
|
+
obj.newPublicKey = base64FromBytes4(message.newPublicKey);
|
|
6334
|
+
}
|
|
6335
|
+
if (message.oldSignature.length !== 0) {
|
|
6336
|
+
obj.oldSignature = base64FromBytes4(message.oldSignature);
|
|
6337
|
+
}
|
|
6338
|
+
if (message.newSignature.length !== 0) {
|
|
6339
|
+
obj.newSignature = base64FromBytes4(message.newSignature);
|
|
6340
|
+
}
|
|
6341
|
+
return obj;
|
|
6342
|
+
},
|
|
6343
|
+
create(base) {
|
|
6344
|
+
return MsgRotatePQCKey.fromPartial(base ?? {});
|
|
6345
|
+
},
|
|
6346
|
+
fromPartial(object) {
|
|
6347
|
+
const message = createBaseMsgRotatePQCKey();
|
|
6348
|
+
message.sender = object.sender ?? "";
|
|
6349
|
+
message.oldPublicKey = object.oldPublicKey ?? new Uint8Array(0);
|
|
6350
|
+
message.newPublicKey = object.newPublicKey ?? new Uint8Array(0);
|
|
6351
|
+
message.oldSignature = object.oldSignature ?? new Uint8Array(0);
|
|
6352
|
+
message.newSignature = object.newSignature ?? new Uint8Array(0);
|
|
6353
|
+
return message;
|
|
6354
|
+
}
|
|
6355
|
+
};
|
|
6356
|
+
function createBaseMsgRotatePQCKeyResponse() {
|
|
6357
|
+
return {};
|
|
6358
|
+
}
|
|
6359
|
+
var MsgRotatePQCKeyResponse = {
|
|
6360
|
+
encode(_, writer = new BinaryWriter()) {
|
|
6361
|
+
return writer;
|
|
6362
|
+
},
|
|
6363
|
+
decode(input, length) {
|
|
6364
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
6365
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
6366
|
+
const message = createBaseMsgRotatePQCKeyResponse();
|
|
6367
|
+
while (reader.pos < end) {
|
|
6368
|
+
const tag = reader.uint32();
|
|
6369
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
6370
|
+
break;
|
|
6371
|
+
}
|
|
6372
|
+
reader.skip(tag & 7);
|
|
6373
|
+
}
|
|
6374
|
+
return message;
|
|
6375
|
+
},
|
|
6376
|
+
fromJSON(_) {
|
|
6377
|
+
return {};
|
|
6378
|
+
},
|
|
6379
|
+
toJSON(_) {
|
|
6380
|
+
const obj = {};
|
|
6381
|
+
return obj;
|
|
6382
|
+
},
|
|
6383
|
+
create(base) {
|
|
6384
|
+
return MsgRotatePQCKeyResponse.fromPartial(base ?? {});
|
|
6385
|
+
},
|
|
6386
|
+
fromPartial(_) {
|
|
6387
|
+
const message = createBaseMsgRotatePQCKeyResponse();
|
|
6388
|
+
return message;
|
|
6389
|
+
}
|
|
6390
|
+
};
|
|
6206
6391
|
function createBaseMsgDeprecateAlgorithm() {
|
|
6207
6392
|
return { authority: "", algorithmId: 0, migrationBlocks: "0", replacementAlgorithmId: 0 };
|
|
6208
6393
|
}
|
|
@@ -6485,6 +6670,20 @@ var MsgDefinition5 = {
|
|
|
6485
6670
|
responseStream: false,
|
|
6486
6671
|
options: {}
|
|
6487
6672
|
},
|
|
6673
|
+
/**
|
|
6674
|
+
* RotatePQCKey replaces an account's PQC key with a NEW key of the SAME
|
|
6675
|
+
* algorithm — for rotating a compromised key or moving a legacy-derived key to
|
|
6676
|
+
* the canonical derivation. Dual-signed (old proves ownership, new proves
|
|
6677
|
+
* control); needs no active algorithm migration.
|
|
6678
|
+
*/
|
|
6679
|
+
rotatePQCKey: {
|
|
6680
|
+
name: "RotatePQCKey",
|
|
6681
|
+
requestType: MsgRotatePQCKey,
|
|
6682
|
+
requestStream: false,
|
|
6683
|
+
responseType: MsgRotatePQCKeyResponse,
|
|
6684
|
+
responseStream: false,
|
|
6685
|
+
options: {}
|
|
6686
|
+
},
|
|
6488
6687
|
/** DeprecateAlgorithm starts the migration period for an algorithm (governance). */
|
|
6489
6688
|
deprecateAlgorithm: {
|
|
6490
6689
|
name: "DeprecateAlgorithm",
|
|
@@ -6544,7 +6743,10 @@ __export(tx_exports6, {
|
|
|
6544
6743
|
MsgExecuteProgramResponse: () => MsgExecuteProgramResponse,
|
|
6545
6744
|
MsgRegisterSVMPQCKey: () => MsgRegisterSVMPQCKey,
|
|
6546
6745
|
MsgRegisterSVMPQCKeyResponse: () => MsgRegisterSVMPQCKeyResponse,
|
|
6746
|
+
MsgUpdateParams: () => MsgUpdateParams,
|
|
6747
|
+
MsgUpdateParamsResponse: () => MsgUpdateParamsResponse,
|
|
6547
6748
|
SVMAuth: () => SVMAuth,
|
|
6749
|
+
SVMParams: () => SVMParams,
|
|
6548
6750
|
SvmAccountMeta: () => SvmAccountMeta,
|
|
6549
6751
|
protobufPackage: () => protobufPackage6
|
|
6550
6752
|
});
|
|
@@ -7281,138 +7483,118 @@ var MsgRegisterSVMPQCKeyResponse = {
|
|
|
7281
7483
|
return message;
|
|
7282
7484
|
}
|
|
7283
7485
|
};
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7291
|
-
|
|
7292
|
-
|
|
7293
|
-
|
|
7294
|
-
|
|
7295
|
-
|
|
7296
|
-
createAccount: {
|
|
7297
|
-
name: "CreateAccount",
|
|
7298
|
-
requestType: MsgCreateAccount,
|
|
7299
|
-
requestStream: false,
|
|
7300
|
-
responseType: MsgCreateAccountResponse,
|
|
7301
|
-
responseStream: false,
|
|
7302
|
-
options: {}
|
|
7303
|
-
},
|
|
7304
|
-
executeProgram: {
|
|
7305
|
-
name: "ExecuteProgram",
|
|
7306
|
-
requestType: MsgExecuteProgram,
|
|
7307
|
-
requestStream: false,
|
|
7308
|
-
responseType: MsgExecuteProgramResponse,
|
|
7309
|
-
responseStream: false,
|
|
7310
|
-
options: {}
|
|
7311
|
-
},
|
|
7312
|
-
registerSVMPQCKey: {
|
|
7313
|
-
name: "RegisterSVMPQCKey",
|
|
7314
|
-
requestType: MsgRegisterSVMPQCKey,
|
|
7315
|
-
requestStream: false,
|
|
7316
|
-
responseType: MsgRegisterSVMPQCKeyResponse,
|
|
7317
|
-
responseStream: false,
|
|
7318
|
-
options: {}
|
|
7319
|
-
}
|
|
7320
|
-
}
|
|
7321
|
-
};
|
|
7322
|
-
function bytesFromBase645(b64) {
|
|
7323
|
-
if (globalThis.Buffer) {
|
|
7324
|
-
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
7325
|
-
} else {
|
|
7326
|
-
const bin = globalThis.atob(b64);
|
|
7327
|
-
const arr = new Uint8Array(bin.length);
|
|
7328
|
-
for (let i = 0; i < bin.length; ++i) {
|
|
7329
|
-
arr[i] = bin.charCodeAt(i);
|
|
7330
|
-
}
|
|
7331
|
-
return arr;
|
|
7332
|
-
}
|
|
7333
|
-
}
|
|
7334
|
-
function base64FromBytes5(arr) {
|
|
7335
|
-
if (globalThis.Buffer) {
|
|
7336
|
-
return globalThis.Buffer.from(arr).toString("base64");
|
|
7337
|
-
} else {
|
|
7338
|
-
const bin = [];
|
|
7339
|
-
arr.forEach((byte) => {
|
|
7340
|
-
bin.push(globalThis.String.fromCharCode(byte));
|
|
7341
|
-
});
|
|
7342
|
-
return globalThis.btoa(bin.join(""));
|
|
7343
|
-
}
|
|
7344
|
-
}
|
|
7345
|
-
function isSet7(value) {
|
|
7346
|
-
return value !== null && value !== void 0;
|
|
7347
|
-
}
|
|
7348
|
-
|
|
7349
|
-
// src/codegen/qorechain/lightnode/v1/tx.ts
|
|
7350
|
-
var tx_exports7 = {};
|
|
7351
|
-
__export(tx_exports7, {
|
|
7352
|
-
MsgClaimLightNodeRewards: () => MsgClaimLightNodeRewards,
|
|
7353
|
-
MsgClaimLightNodeRewardsResponse: () => MsgClaimLightNodeRewardsResponse,
|
|
7354
|
-
MsgDefinition: () => MsgDefinition7,
|
|
7355
|
-
MsgDeregisterLightNode: () => MsgDeregisterLightNode,
|
|
7356
|
-
MsgDeregisterLightNodeResponse: () => MsgDeregisterLightNodeResponse,
|
|
7357
|
-
MsgHeartbeat: () => MsgHeartbeat,
|
|
7358
|
-
MsgHeartbeatResponse: () => MsgHeartbeatResponse,
|
|
7359
|
-
MsgRegisterLightNode: () => MsgRegisterLightNode,
|
|
7360
|
-
MsgRegisterLightNodeResponse: () => MsgRegisterLightNodeResponse,
|
|
7361
|
-
protobufPackage: () => protobufPackage7
|
|
7362
|
-
});
|
|
7363
|
-
var protobufPackage7 = "qorechain.lightnode.v1";
|
|
7364
|
-
function createBaseMsgRegisterLightNode() {
|
|
7365
|
-
return { operator: "", nodeType: "", version: "", capabilities: [] };
|
|
7486
|
+
function createBaseSVMParams() {
|
|
7487
|
+
return {
|
|
7488
|
+
maxProgramSize: "0",
|
|
7489
|
+
maxAccountDataSize: "0",
|
|
7490
|
+
computeBudgetMax: "0",
|
|
7491
|
+
lamportsPerByte: "0",
|
|
7492
|
+
rentExemptionMulti: "",
|
|
7493
|
+
enabled: false,
|
|
7494
|
+
svmSlotOffset: "0",
|
|
7495
|
+
defaultSigScheme: 0,
|
|
7496
|
+
maxCpi: 0
|
|
7497
|
+
};
|
|
7366
7498
|
}
|
|
7367
|
-
var
|
|
7499
|
+
var SVMParams = {
|
|
7368
7500
|
encode(message, writer = new BinaryWriter()) {
|
|
7369
|
-
if (message.
|
|
7370
|
-
writer.uint32(
|
|
7501
|
+
if (message.maxProgramSize !== "0") {
|
|
7502
|
+
writer.uint32(8).uint64(message.maxProgramSize);
|
|
7371
7503
|
}
|
|
7372
|
-
if (message.
|
|
7373
|
-
writer.uint32(
|
|
7504
|
+
if (message.maxAccountDataSize !== "0") {
|
|
7505
|
+
writer.uint32(16).uint64(message.maxAccountDataSize);
|
|
7374
7506
|
}
|
|
7375
|
-
if (message.
|
|
7376
|
-
writer.uint32(
|
|
7507
|
+
if (message.computeBudgetMax !== "0") {
|
|
7508
|
+
writer.uint32(24).uint64(message.computeBudgetMax);
|
|
7377
7509
|
}
|
|
7378
|
-
|
|
7379
|
-
writer.uint32(
|
|
7510
|
+
if (message.lamportsPerByte !== "0") {
|
|
7511
|
+
writer.uint32(32).uint64(message.lamportsPerByte);
|
|
7380
7512
|
}
|
|
7381
|
-
|
|
7513
|
+
if (message.rentExemptionMulti !== "") {
|
|
7514
|
+
writer.uint32(42).string(message.rentExemptionMulti);
|
|
7515
|
+
}
|
|
7516
|
+
if (message.enabled !== false) {
|
|
7517
|
+
writer.uint32(48).bool(message.enabled);
|
|
7518
|
+
}
|
|
7519
|
+
if (message.svmSlotOffset !== "0") {
|
|
7520
|
+
writer.uint32(56).int64(message.svmSlotOffset);
|
|
7521
|
+
}
|
|
7522
|
+
if (message.defaultSigScheme !== 0) {
|
|
7523
|
+
writer.uint32(64).uint32(message.defaultSigScheme);
|
|
7524
|
+
}
|
|
7525
|
+
if (message.maxCpi !== 0) {
|
|
7526
|
+
writer.uint32(72).uint32(message.maxCpi);
|
|
7527
|
+
}
|
|
7528
|
+
return writer;
|
|
7382
7529
|
},
|
|
7383
7530
|
decode(input, length) {
|
|
7384
7531
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
7385
7532
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
7386
|
-
const message =
|
|
7533
|
+
const message = createBaseSVMParams();
|
|
7387
7534
|
while (reader.pos < end) {
|
|
7388
7535
|
const tag = reader.uint32();
|
|
7389
7536
|
switch (tag >>> 3) {
|
|
7390
7537
|
case 1: {
|
|
7391
|
-
if (tag !==
|
|
7538
|
+
if (tag !== 8) {
|
|
7392
7539
|
break;
|
|
7393
7540
|
}
|
|
7394
|
-
message.
|
|
7541
|
+
message.maxProgramSize = reader.uint64().toString();
|
|
7395
7542
|
continue;
|
|
7396
7543
|
}
|
|
7397
7544
|
case 2: {
|
|
7398
|
-
if (tag !==
|
|
7545
|
+
if (tag !== 16) {
|
|
7399
7546
|
break;
|
|
7400
7547
|
}
|
|
7401
|
-
message.
|
|
7548
|
+
message.maxAccountDataSize = reader.uint64().toString();
|
|
7402
7549
|
continue;
|
|
7403
7550
|
}
|
|
7404
7551
|
case 3: {
|
|
7405
|
-
if (tag !==
|
|
7552
|
+
if (tag !== 24) {
|
|
7406
7553
|
break;
|
|
7407
7554
|
}
|
|
7408
|
-
message.
|
|
7555
|
+
message.computeBudgetMax = reader.uint64().toString();
|
|
7409
7556
|
continue;
|
|
7410
7557
|
}
|
|
7411
7558
|
case 4: {
|
|
7412
|
-
if (tag !==
|
|
7559
|
+
if (tag !== 32) {
|
|
7413
7560
|
break;
|
|
7414
7561
|
}
|
|
7415
|
-
message.
|
|
7562
|
+
message.lamportsPerByte = reader.uint64().toString();
|
|
7563
|
+
continue;
|
|
7564
|
+
}
|
|
7565
|
+
case 5: {
|
|
7566
|
+
if (tag !== 42) {
|
|
7567
|
+
break;
|
|
7568
|
+
}
|
|
7569
|
+
message.rentExemptionMulti = reader.string();
|
|
7570
|
+
continue;
|
|
7571
|
+
}
|
|
7572
|
+
case 6: {
|
|
7573
|
+
if (tag !== 48) {
|
|
7574
|
+
break;
|
|
7575
|
+
}
|
|
7576
|
+
message.enabled = reader.bool();
|
|
7577
|
+
continue;
|
|
7578
|
+
}
|
|
7579
|
+
case 7: {
|
|
7580
|
+
if (tag !== 56) {
|
|
7581
|
+
break;
|
|
7582
|
+
}
|
|
7583
|
+
message.svmSlotOffset = reader.int64().toString();
|
|
7584
|
+
continue;
|
|
7585
|
+
}
|
|
7586
|
+
case 8: {
|
|
7587
|
+
if (tag !== 64) {
|
|
7588
|
+
break;
|
|
7589
|
+
}
|
|
7590
|
+
message.defaultSigScheme = reader.uint32();
|
|
7591
|
+
continue;
|
|
7592
|
+
}
|
|
7593
|
+
case 9: {
|
|
7594
|
+
if (tag !== 72) {
|
|
7595
|
+
break;
|
|
7596
|
+
}
|
|
7597
|
+
message.maxCpi = reader.uint32();
|
|
7416
7598
|
continue;
|
|
7417
7599
|
}
|
|
7418
7600
|
}
|
|
@@ -7425,89 +7607,82 @@ var MsgRegisterLightNode = {
|
|
|
7425
7607
|
},
|
|
7426
7608
|
fromJSON(object) {
|
|
7427
7609
|
return {
|
|
7428
|
-
|
|
7429
|
-
|
|
7430
|
-
|
|
7431
|
-
|
|
7610
|
+
maxProgramSize: isSet7(object.maxProgramSize) ? globalThis.String(object.maxProgramSize) : isSet7(object.max_program_size) ? globalThis.String(object.max_program_size) : "0",
|
|
7611
|
+
maxAccountDataSize: isSet7(object.maxAccountDataSize) ? globalThis.String(object.maxAccountDataSize) : isSet7(object.max_account_data_size) ? globalThis.String(object.max_account_data_size) : "0",
|
|
7612
|
+
computeBudgetMax: isSet7(object.computeBudgetMax) ? globalThis.String(object.computeBudgetMax) : isSet7(object.compute_budget_max) ? globalThis.String(object.compute_budget_max) : "0",
|
|
7613
|
+
lamportsPerByte: isSet7(object.lamportsPerByte) ? globalThis.String(object.lamportsPerByte) : isSet7(object.lamports_per_byte) ? globalThis.String(object.lamports_per_byte) : "0",
|
|
7614
|
+
rentExemptionMulti: isSet7(object.rentExemptionMulti) ? globalThis.String(object.rentExemptionMulti) : isSet7(object.rent_exemption_multi) ? globalThis.String(object.rent_exemption_multi) : "",
|
|
7615
|
+
enabled: isSet7(object.enabled) ? globalThis.Boolean(object.enabled) : false,
|
|
7616
|
+
svmSlotOffset: isSet7(object.svmSlotOffset) ? globalThis.String(object.svmSlotOffset) : isSet7(object.svm_slot_offset) ? globalThis.String(object.svm_slot_offset) : "0",
|
|
7617
|
+
defaultSigScheme: isSet7(object.defaultSigScheme) ? globalThis.Number(object.defaultSigScheme) : isSet7(object.default_sig_scheme) ? globalThis.Number(object.default_sig_scheme) : 0,
|
|
7618
|
+
maxCpi: isSet7(object.maxCpi) ? globalThis.Number(object.maxCpi) : isSet7(object.max_cpi) ? globalThis.Number(object.max_cpi) : 0
|
|
7432
7619
|
};
|
|
7433
7620
|
},
|
|
7434
7621
|
toJSON(message) {
|
|
7435
7622
|
const obj = {};
|
|
7436
|
-
if (message.
|
|
7437
|
-
obj.
|
|
7623
|
+
if (message.maxProgramSize !== "0") {
|
|
7624
|
+
obj.maxProgramSize = message.maxProgramSize;
|
|
7438
7625
|
}
|
|
7439
|
-
if (message.
|
|
7440
|
-
obj.
|
|
7626
|
+
if (message.maxAccountDataSize !== "0") {
|
|
7627
|
+
obj.maxAccountDataSize = message.maxAccountDataSize;
|
|
7441
7628
|
}
|
|
7442
|
-
if (message.
|
|
7443
|
-
obj.
|
|
7629
|
+
if (message.computeBudgetMax !== "0") {
|
|
7630
|
+
obj.computeBudgetMax = message.computeBudgetMax;
|
|
7444
7631
|
}
|
|
7445
|
-
if (message.
|
|
7446
|
-
obj.
|
|
7632
|
+
if (message.lamportsPerByte !== "0") {
|
|
7633
|
+
obj.lamportsPerByte = message.lamportsPerByte;
|
|
7447
7634
|
}
|
|
7448
|
-
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
message.
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
|
|
7461
|
-
|
|
7462
|
-
function createBaseMsgRegisterLightNodeResponse() {
|
|
7463
|
-
return {};
|
|
7464
|
-
}
|
|
7465
|
-
var MsgRegisterLightNodeResponse = {
|
|
7466
|
-
encode(_, writer = new BinaryWriter()) {
|
|
7467
|
-
return writer;
|
|
7468
|
-
},
|
|
7469
|
-
decode(input, length) {
|
|
7470
|
-
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
7471
|
-
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
7472
|
-
const message = createBaseMsgRegisterLightNodeResponse();
|
|
7473
|
-
while (reader.pos < end) {
|
|
7474
|
-
const tag = reader.uint32();
|
|
7475
|
-
if ((tag & 7) === 4 || tag === 0) {
|
|
7476
|
-
break;
|
|
7477
|
-
}
|
|
7478
|
-
reader.skip(tag & 7);
|
|
7635
|
+
if (message.rentExemptionMulti !== "") {
|
|
7636
|
+
obj.rentExemptionMulti = message.rentExemptionMulti;
|
|
7637
|
+
}
|
|
7638
|
+
if (message.enabled !== false) {
|
|
7639
|
+
obj.enabled = message.enabled;
|
|
7640
|
+
}
|
|
7641
|
+
if (message.svmSlotOffset !== "0") {
|
|
7642
|
+
obj.svmSlotOffset = message.svmSlotOffset;
|
|
7643
|
+
}
|
|
7644
|
+
if (message.defaultSigScheme !== 0) {
|
|
7645
|
+
obj.defaultSigScheme = Math.round(message.defaultSigScheme);
|
|
7646
|
+
}
|
|
7647
|
+
if (message.maxCpi !== 0) {
|
|
7648
|
+
obj.maxCpi = Math.round(message.maxCpi);
|
|
7479
7649
|
}
|
|
7480
|
-
return message;
|
|
7481
|
-
},
|
|
7482
|
-
fromJSON(_) {
|
|
7483
|
-
return {};
|
|
7484
|
-
},
|
|
7485
|
-
toJSON(_) {
|
|
7486
|
-
const obj = {};
|
|
7487
7650
|
return obj;
|
|
7488
7651
|
},
|
|
7489
7652
|
create(base) {
|
|
7490
|
-
return
|
|
7653
|
+
return SVMParams.fromPartial(base ?? {});
|
|
7491
7654
|
},
|
|
7492
|
-
fromPartial(
|
|
7493
|
-
const message =
|
|
7655
|
+
fromPartial(object) {
|
|
7656
|
+
const message = createBaseSVMParams();
|
|
7657
|
+
message.maxProgramSize = object.maxProgramSize ?? "0";
|
|
7658
|
+
message.maxAccountDataSize = object.maxAccountDataSize ?? "0";
|
|
7659
|
+
message.computeBudgetMax = object.computeBudgetMax ?? "0";
|
|
7660
|
+
message.lamportsPerByte = object.lamportsPerByte ?? "0";
|
|
7661
|
+
message.rentExemptionMulti = object.rentExemptionMulti ?? "";
|
|
7662
|
+
message.enabled = object.enabled ?? false;
|
|
7663
|
+
message.svmSlotOffset = object.svmSlotOffset ?? "0";
|
|
7664
|
+
message.defaultSigScheme = object.defaultSigScheme ?? 0;
|
|
7665
|
+
message.maxCpi = object.maxCpi ?? 0;
|
|
7494
7666
|
return message;
|
|
7495
7667
|
}
|
|
7496
7668
|
};
|
|
7497
|
-
function
|
|
7498
|
-
return {
|
|
7669
|
+
function createBaseMsgUpdateParams() {
|
|
7670
|
+
return { authority: "", params: void 0 };
|
|
7499
7671
|
}
|
|
7500
|
-
var
|
|
7672
|
+
var MsgUpdateParams = {
|
|
7501
7673
|
encode(message, writer = new BinaryWriter()) {
|
|
7502
|
-
if (message.
|
|
7503
|
-
writer.uint32(10).string(message.
|
|
7674
|
+
if (message.authority !== "") {
|
|
7675
|
+
writer.uint32(10).string(message.authority);
|
|
7676
|
+
}
|
|
7677
|
+
if (message.params !== void 0) {
|
|
7678
|
+
SVMParams.encode(message.params, writer.uint32(18).fork()).join();
|
|
7504
7679
|
}
|
|
7505
7680
|
return writer;
|
|
7506
7681
|
},
|
|
7507
7682
|
decode(input, length) {
|
|
7508
7683
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
7509
7684
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
7510
|
-
const message =
|
|
7685
|
+
const message = createBaseMsgUpdateParams();
|
|
7511
7686
|
while (reader.pos < end) {
|
|
7512
7687
|
const tag = reader.uint32();
|
|
7513
7688
|
switch (tag >>> 3) {
|
|
@@ -7515,7 +7690,14 @@ var MsgHeartbeat = {
|
|
|
7515
7690
|
if (tag !== 10) {
|
|
7516
7691
|
break;
|
|
7517
7692
|
}
|
|
7518
|
-
message.
|
|
7693
|
+
message.authority = reader.string();
|
|
7694
|
+
continue;
|
|
7695
|
+
}
|
|
7696
|
+
case 2: {
|
|
7697
|
+
if (tag !== 18) {
|
|
7698
|
+
break;
|
|
7699
|
+
}
|
|
7700
|
+
message.params = SVMParams.decode(reader, reader.uint32());
|
|
7519
7701
|
continue;
|
|
7520
7702
|
}
|
|
7521
7703
|
}
|
|
@@ -7527,35 +7709,42 @@ var MsgHeartbeat = {
|
|
|
7527
7709
|
return message;
|
|
7528
7710
|
},
|
|
7529
7711
|
fromJSON(object) {
|
|
7530
|
-
return {
|
|
7712
|
+
return {
|
|
7713
|
+
authority: isSet7(object.authority) ? globalThis.String(object.authority) : "",
|
|
7714
|
+
params: isSet7(object.params) ? SVMParams.fromJSON(object.params) : void 0
|
|
7715
|
+
};
|
|
7531
7716
|
},
|
|
7532
7717
|
toJSON(message) {
|
|
7533
7718
|
const obj = {};
|
|
7534
|
-
if (message.
|
|
7535
|
-
obj.
|
|
7719
|
+
if (message.authority !== "") {
|
|
7720
|
+
obj.authority = message.authority;
|
|
7721
|
+
}
|
|
7722
|
+
if (message.params !== void 0) {
|
|
7723
|
+
obj.params = SVMParams.toJSON(message.params);
|
|
7536
7724
|
}
|
|
7537
7725
|
return obj;
|
|
7538
7726
|
},
|
|
7539
7727
|
create(base) {
|
|
7540
|
-
return
|
|
7728
|
+
return MsgUpdateParams.fromPartial(base ?? {});
|
|
7541
7729
|
},
|
|
7542
7730
|
fromPartial(object) {
|
|
7543
|
-
const message =
|
|
7544
|
-
message.
|
|
7731
|
+
const message = createBaseMsgUpdateParams();
|
|
7732
|
+
message.authority = object.authority ?? "";
|
|
7733
|
+
message.params = object.params !== void 0 && object.params !== null ? SVMParams.fromPartial(object.params) : void 0;
|
|
7545
7734
|
return message;
|
|
7546
7735
|
}
|
|
7547
7736
|
};
|
|
7548
|
-
function
|
|
7737
|
+
function createBaseMsgUpdateParamsResponse() {
|
|
7549
7738
|
return {};
|
|
7550
7739
|
}
|
|
7551
|
-
var
|
|
7740
|
+
var MsgUpdateParamsResponse = {
|
|
7552
7741
|
encode(_, writer = new BinaryWriter()) {
|
|
7553
7742
|
return writer;
|
|
7554
7743
|
},
|
|
7555
7744
|
decode(input, length) {
|
|
7556
7745
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
7557
7746
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
7558
|
-
const message =
|
|
7747
|
+
const message = createBaseMsgUpdateParamsResponse();
|
|
7559
7748
|
while (reader.pos < end) {
|
|
7560
7749
|
const tag = reader.uint32();
|
|
7561
7750
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -7573,27 +7762,124 @@ var MsgHeartbeatResponse = {
|
|
|
7573
7762
|
return obj;
|
|
7574
7763
|
},
|
|
7575
7764
|
create(base) {
|
|
7576
|
-
return
|
|
7765
|
+
return MsgUpdateParamsResponse.fromPartial(base ?? {});
|
|
7577
7766
|
},
|
|
7578
7767
|
fromPartial(_) {
|
|
7579
|
-
const message =
|
|
7768
|
+
const message = createBaseMsgUpdateParamsResponse();
|
|
7580
7769
|
return message;
|
|
7581
7770
|
}
|
|
7582
7771
|
};
|
|
7583
|
-
|
|
7584
|
-
|
|
7772
|
+
var MsgDefinition6 = {
|
|
7773
|
+
name: "Msg",
|
|
7774
|
+
fullName: "qorechain.svm.v1.Msg",
|
|
7775
|
+
methods: {
|
|
7776
|
+
deployProgram: {
|
|
7777
|
+
name: "DeployProgram",
|
|
7778
|
+
requestType: MsgDeployProgram,
|
|
7779
|
+
requestStream: false,
|
|
7780
|
+
responseType: MsgDeployProgramResponse,
|
|
7781
|
+
responseStream: false,
|
|
7782
|
+
options: {}
|
|
7783
|
+
},
|
|
7784
|
+
createAccount: {
|
|
7785
|
+
name: "CreateAccount",
|
|
7786
|
+
requestType: MsgCreateAccount,
|
|
7787
|
+
requestStream: false,
|
|
7788
|
+
responseType: MsgCreateAccountResponse,
|
|
7789
|
+
responseStream: false,
|
|
7790
|
+
options: {}
|
|
7791
|
+
},
|
|
7792
|
+
executeProgram: {
|
|
7793
|
+
name: "ExecuteProgram",
|
|
7794
|
+
requestType: MsgExecuteProgram,
|
|
7795
|
+
requestStream: false,
|
|
7796
|
+
responseType: MsgExecuteProgramResponse,
|
|
7797
|
+
responseStream: false,
|
|
7798
|
+
options: {}
|
|
7799
|
+
},
|
|
7800
|
+
registerSVMPQCKey: {
|
|
7801
|
+
name: "RegisterSVMPQCKey",
|
|
7802
|
+
requestType: MsgRegisterSVMPQCKey,
|
|
7803
|
+
requestStream: false,
|
|
7804
|
+
responseType: MsgRegisterSVMPQCKeyResponse,
|
|
7805
|
+
responseStream: false,
|
|
7806
|
+
options: {}
|
|
7807
|
+
},
|
|
7808
|
+
updateParams: {
|
|
7809
|
+
name: "UpdateParams",
|
|
7810
|
+
requestType: MsgUpdateParams,
|
|
7811
|
+
requestStream: false,
|
|
7812
|
+
responseType: MsgUpdateParamsResponse,
|
|
7813
|
+
responseStream: false,
|
|
7814
|
+
options: {}
|
|
7815
|
+
}
|
|
7816
|
+
}
|
|
7817
|
+
};
|
|
7818
|
+
function bytesFromBase645(b64) {
|
|
7819
|
+
if (globalThis.Buffer) {
|
|
7820
|
+
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
|
7821
|
+
} else {
|
|
7822
|
+
const bin = globalThis.atob(b64);
|
|
7823
|
+
const arr = new Uint8Array(bin.length);
|
|
7824
|
+
for (let i = 0; i < bin.length; ++i) {
|
|
7825
|
+
arr[i] = bin.charCodeAt(i);
|
|
7826
|
+
}
|
|
7827
|
+
return arr;
|
|
7828
|
+
}
|
|
7585
7829
|
}
|
|
7586
|
-
|
|
7830
|
+
function base64FromBytes5(arr) {
|
|
7831
|
+
if (globalThis.Buffer) {
|
|
7832
|
+
return globalThis.Buffer.from(arr).toString("base64");
|
|
7833
|
+
} else {
|
|
7834
|
+
const bin = [];
|
|
7835
|
+
arr.forEach((byte) => {
|
|
7836
|
+
bin.push(globalThis.String.fromCharCode(byte));
|
|
7837
|
+
});
|
|
7838
|
+
return globalThis.btoa(bin.join(""));
|
|
7839
|
+
}
|
|
7840
|
+
}
|
|
7841
|
+
function isSet7(value) {
|
|
7842
|
+
return value !== null && value !== void 0;
|
|
7843
|
+
}
|
|
7844
|
+
|
|
7845
|
+
// src/codegen/qorechain/lightnode/v1/tx.ts
|
|
7846
|
+
var tx_exports7 = {};
|
|
7847
|
+
__export(tx_exports7, {
|
|
7848
|
+
MsgClaimLightNodeRewards: () => MsgClaimLightNodeRewards,
|
|
7849
|
+
MsgClaimLightNodeRewardsResponse: () => MsgClaimLightNodeRewardsResponse,
|
|
7850
|
+
MsgDefinition: () => MsgDefinition7,
|
|
7851
|
+
MsgDeregisterLightNode: () => MsgDeregisterLightNode,
|
|
7852
|
+
MsgDeregisterLightNodeResponse: () => MsgDeregisterLightNodeResponse,
|
|
7853
|
+
MsgHeartbeat: () => MsgHeartbeat,
|
|
7854
|
+
MsgHeartbeatResponse: () => MsgHeartbeatResponse,
|
|
7855
|
+
MsgRegisterLightNode: () => MsgRegisterLightNode,
|
|
7856
|
+
MsgRegisterLightNodeResponse: () => MsgRegisterLightNodeResponse,
|
|
7857
|
+
protobufPackage: () => protobufPackage7
|
|
7858
|
+
});
|
|
7859
|
+
var protobufPackage7 = "qorechain.lightnode.v1";
|
|
7860
|
+
function createBaseMsgRegisterLightNode() {
|
|
7861
|
+
return { operator: "", nodeType: "", version: "", capabilities: [] };
|
|
7862
|
+
}
|
|
7863
|
+
var MsgRegisterLightNode = {
|
|
7587
7864
|
encode(message, writer = new BinaryWriter()) {
|
|
7588
7865
|
if (message.operator !== "") {
|
|
7589
7866
|
writer.uint32(10).string(message.operator);
|
|
7590
7867
|
}
|
|
7868
|
+
if (message.nodeType !== "") {
|
|
7869
|
+
writer.uint32(18).string(message.nodeType);
|
|
7870
|
+
}
|
|
7871
|
+
if (message.version !== "") {
|
|
7872
|
+
writer.uint32(26).string(message.version);
|
|
7873
|
+
}
|
|
7874
|
+
for (const v of message.capabilities) {
|
|
7875
|
+
writer.uint32(34).string(v);
|
|
7876
|
+
}
|
|
7591
7877
|
return writer;
|
|
7592
7878
|
},
|
|
7593
7879
|
decode(input, length) {
|
|
7594
7880
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
7595
7881
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
7596
|
-
const message =
|
|
7882
|
+
const message = createBaseMsgRegisterLightNode();
|
|
7597
7883
|
while (reader.pos < end) {
|
|
7598
7884
|
const tag = reader.uint32();
|
|
7599
7885
|
switch (tag >>> 3) {
|
|
@@ -7604,13 +7890,223 @@ var MsgDeregisterLightNode = {
|
|
|
7604
7890
|
message.operator = reader.string();
|
|
7605
7891
|
continue;
|
|
7606
7892
|
}
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7893
|
+
case 2: {
|
|
7894
|
+
if (tag !== 18) {
|
|
7895
|
+
break;
|
|
7896
|
+
}
|
|
7897
|
+
message.nodeType = reader.string();
|
|
7898
|
+
continue;
|
|
7899
|
+
}
|
|
7900
|
+
case 3: {
|
|
7901
|
+
if (tag !== 26) {
|
|
7902
|
+
break;
|
|
7903
|
+
}
|
|
7904
|
+
message.version = reader.string();
|
|
7905
|
+
continue;
|
|
7906
|
+
}
|
|
7907
|
+
case 4: {
|
|
7908
|
+
if (tag !== 34) {
|
|
7909
|
+
break;
|
|
7910
|
+
}
|
|
7911
|
+
message.capabilities.push(reader.string());
|
|
7912
|
+
continue;
|
|
7913
|
+
}
|
|
7914
|
+
}
|
|
7915
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
7916
|
+
break;
|
|
7917
|
+
}
|
|
7918
|
+
reader.skip(tag & 7);
|
|
7919
|
+
}
|
|
7920
|
+
return message;
|
|
7921
|
+
},
|
|
7922
|
+
fromJSON(object) {
|
|
7923
|
+
return {
|
|
7924
|
+
operator: isSet8(object.operator) ? globalThis.String(object.operator) : "",
|
|
7925
|
+
nodeType: isSet8(object.nodeType) ? globalThis.String(object.nodeType) : isSet8(object.node_type) ? globalThis.String(object.node_type) : "",
|
|
7926
|
+
version: isSet8(object.version) ? globalThis.String(object.version) : "",
|
|
7927
|
+
capabilities: globalThis.Array.isArray(object?.capabilities) ? object.capabilities.map((e) => globalThis.String(e)) : []
|
|
7928
|
+
};
|
|
7929
|
+
},
|
|
7930
|
+
toJSON(message) {
|
|
7931
|
+
const obj = {};
|
|
7932
|
+
if (message.operator !== "") {
|
|
7933
|
+
obj.operator = message.operator;
|
|
7934
|
+
}
|
|
7935
|
+
if (message.nodeType !== "") {
|
|
7936
|
+
obj.nodeType = message.nodeType;
|
|
7937
|
+
}
|
|
7938
|
+
if (message.version !== "") {
|
|
7939
|
+
obj.version = message.version;
|
|
7940
|
+
}
|
|
7941
|
+
if (message.capabilities?.length) {
|
|
7942
|
+
obj.capabilities = message.capabilities;
|
|
7943
|
+
}
|
|
7944
|
+
return obj;
|
|
7945
|
+
},
|
|
7946
|
+
create(base) {
|
|
7947
|
+
return MsgRegisterLightNode.fromPartial(base ?? {});
|
|
7948
|
+
},
|
|
7949
|
+
fromPartial(object) {
|
|
7950
|
+
const message = createBaseMsgRegisterLightNode();
|
|
7951
|
+
message.operator = object.operator ?? "";
|
|
7952
|
+
message.nodeType = object.nodeType ?? "";
|
|
7953
|
+
message.version = object.version ?? "";
|
|
7954
|
+
message.capabilities = object.capabilities?.map((e) => e) || [];
|
|
7955
|
+
return message;
|
|
7956
|
+
}
|
|
7957
|
+
};
|
|
7958
|
+
function createBaseMsgRegisterLightNodeResponse() {
|
|
7959
|
+
return {};
|
|
7960
|
+
}
|
|
7961
|
+
var MsgRegisterLightNodeResponse = {
|
|
7962
|
+
encode(_, writer = new BinaryWriter()) {
|
|
7963
|
+
return writer;
|
|
7964
|
+
},
|
|
7965
|
+
decode(input, length) {
|
|
7966
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
7967
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
7968
|
+
const message = createBaseMsgRegisterLightNodeResponse();
|
|
7969
|
+
while (reader.pos < end) {
|
|
7970
|
+
const tag = reader.uint32();
|
|
7971
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
7972
|
+
break;
|
|
7973
|
+
}
|
|
7974
|
+
reader.skip(tag & 7);
|
|
7975
|
+
}
|
|
7976
|
+
return message;
|
|
7977
|
+
},
|
|
7978
|
+
fromJSON(_) {
|
|
7979
|
+
return {};
|
|
7980
|
+
},
|
|
7981
|
+
toJSON(_) {
|
|
7982
|
+
const obj = {};
|
|
7983
|
+
return obj;
|
|
7984
|
+
},
|
|
7985
|
+
create(base) {
|
|
7986
|
+
return MsgRegisterLightNodeResponse.fromPartial(base ?? {});
|
|
7987
|
+
},
|
|
7988
|
+
fromPartial(_) {
|
|
7989
|
+
const message = createBaseMsgRegisterLightNodeResponse();
|
|
7990
|
+
return message;
|
|
7991
|
+
}
|
|
7992
|
+
};
|
|
7993
|
+
function createBaseMsgHeartbeat() {
|
|
7994
|
+
return { operator: "" };
|
|
7995
|
+
}
|
|
7996
|
+
var MsgHeartbeat = {
|
|
7997
|
+
encode(message, writer = new BinaryWriter()) {
|
|
7998
|
+
if (message.operator !== "") {
|
|
7999
|
+
writer.uint32(10).string(message.operator);
|
|
8000
|
+
}
|
|
8001
|
+
return writer;
|
|
8002
|
+
},
|
|
8003
|
+
decode(input, length) {
|
|
8004
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
8005
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8006
|
+
const message = createBaseMsgHeartbeat();
|
|
8007
|
+
while (reader.pos < end) {
|
|
8008
|
+
const tag = reader.uint32();
|
|
8009
|
+
switch (tag >>> 3) {
|
|
8010
|
+
case 1: {
|
|
8011
|
+
if (tag !== 10) {
|
|
8012
|
+
break;
|
|
8013
|
+
}
|
|
8014
|
+
message.operator = reader.string();
|
|
8015
|
+
continue;
|
|
8016
|
+
}
|
|
8017
|
+
}
|
|
8018
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
8019
|
+
break;
|
|
8020
|
+
}
|
|
8021
|
+
reader.skip(tag & 7);
|
|
8022
|
+
}
|
|
8023
|
+
return message;
|
|
8024
|
+
},
|
|
8025
|
+
fromJSON(object) {
|
|
8026
|
+
return { operator: isSet8(object.operator) ? globalThis.String(object.operator) : "" };
|
|
8027
|
+
},
|
|
8028
|
+
toJSON(message) {
|
|
8029
|
+
const obj = {};
|
|
8030
|
+
if (message.operator !== "") {
|
|
8031
|
+
obj.operator = message.operator;
|
|
8032
|
+
}
|
|
8033
|
+
return obj;
|
|
8034
|
+
},
|
|
8035
|
+
create(base) {
|
|
8036
|
+
return MsgHeartbeat.fromPartial(base ?? {});
|
|
8037
|
+
},
|
|
8038
|
+
fromPartial(object) {
|
|
8039
|
+
const message = createBaseMsgHeartbeat();
|
|
8040
|
+
message.operator = object.operator ?? "";
|
|
8041
|
+
return message;
|
|
8042
|
+
}
|
|
8043
|
+
};
|
|
8044
|
+
function createBaseMsgHeartbeatResponse() {
|
|
8045
|
+
return {};
|
|
8046
|
+
}
|
|
8047
|
+
var MsgHeartbeatResponse = {
|
|
8048
|
+
encode(_, writer = new BinaryWriter()) {
|
|
8049
|
+
return writer;
|
|
8050
|
+
},
|
|
8051
|
+
decode(input, length) {
|
|
8052
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
8053
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8054
|
+
const message = createBaseMsgHeartbeatResponse();
|
|
8055
|
+
while (reader.pos < end) {
|
|
8056
|
+
const tag = reader.uint32();
|
|
8057
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
8058
|
+
break;
|
|
8059
|
+
}
|
|
8060
|
+
reader.skip(tag & 7);
|
|
8061
|
+
}
|
|
8062
|
+
return message;
|
|
8063
|
+
},
|
|
8064
|
+
fromJSON(_) {
|
|
8065
|
+
return {};
|
|
8066
|
+
},
|
|
8067
|
+
toJSON(_) {
|
|
8068
|
+
const obj = {};
|
|
8069
|
+
return obj;
|
|
8070
|
+
},
|
|
8071
|
+
create(base) {
|
|
8072
|
+
return MsgHeartbeatResponse.fromPartial(base ?? {});
|
|
8073
|
+
},
|
|
8074
|
+
fromPartial(_) {
|
|
8075
|
+
const message = createBaseMsgHeartbeatResponse();
|
|
8076
|
+
return message;
|
|
8077
|
+
}
|
|
8078
|
+
};
|
|
8079
|
+
function createBaseMsgDeregisterLightNode() {
|
|
8080
|
+
return { operator: "" };
|
|
8081
|
+
}
|
|
8082
|
+
var MsgDeregisterLightNode = {
|
|
8083
|
+
encode(message, writer = new BinaryWriter()) {
|
|
8084
|
+
if (message.operator !== "") {
|
|
8085
|
+
writer.uint32(10).string(message.operator);
|
|
8086
|
+
}
|
|
8087
|
+
return writer;
|
|
8088
|
+
},
|
|
8089
|
+
decode(input, length) {
|
|
8090
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
8091
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8092
|
+
const message = createBaseMsgDeregisterLightNode();
|
|
8093
|
+
while (reader.pos < end) {
|
|
8094
|
+
const tag = reader.uint32();
|
|
8095
|
+
switch (tag >>> 3) {
|
|
8096
|
+
case 1: {
|
|
8097
|
+
if (tag !== 10) {
|
|
8098
|
+
break;
|
|
8099
|
+
}
|
|
8100
|
+
message.operator = reader.string();
|
|
8101
|
+
continue;
|
|
8102
|
+
}
|
|
8103
|
+
}
|
|
8104
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
8105
|
+
break;
|
|
8106
|
+
}
|
|
8107
|
+
reader.skip(tag & 7);
|
|
8108
|
+
}
|
|
8109
|
+
return message;
|
|
7614
8110
|
},
|
|
7615
8111
|
fromJSON(object) {
|
|
7616
8112
|
return { operator: isSet8(object.operator) ? globalThis.String(object.operator) : "" };
|
|
@@ -8359,6 +8855,10 @@ __export(tx_exports9, {
|
|
|
8359
8855
|
MsgCreateAbstractAccount: () => MsgCreateAbstractAccount,
|
|
8360
8856
|
MsgCreateAbstractAccountResponse: () => MsgCreateAbstractAccountResponse,
|
|
8361
8857
|
MsgDefinition: () => MsgDefinition9,
|
|
8858
|
+
MsgExecuteCosmos: () => MsgExecuteCosmos,
|
|
8859
|
+
MsgExecuteCosmosResponse: () => MsgExecuteCosmosResponse,
|
|
8860
|
+
MsgExecuteEVM: () => MsgExecuteEVM,
|
|
8861
|
+
MsgExecuteEVMResponse: () => MsgExecuteEVMResponse,
|
|
8362
8862
|
MsgRegisterAuthenticator: () => MsgRegisterAuthenticator,
|
|
8363
8863
|
MsgRegisterAuthenticatorResponse: () => MsgRegisterAuthenticatorResponse,
|
|
8364
8864
|
MsgRevokeAuthenticator: () => MsgRevokeAuthenticator,
|
|
@@ -8506,14 +9006,309 @@ var MsgCreateAbstractAccount = {
|
|
|
8506
9006
|
if (tag !== 10) {
|
|
8507
9007
|
break;
|
|
8508
9008
|
}
|
|
8509
|
-
message.owner = reader.string();
|
|
9009
|
+
message.owner = reader.string();
|
|
9010
|
+
continue;
|
|
9011
|
+
}
|
|
9012
|
+
case 2: {
|
|
9013
|
+
if (tag !== 18) {
|
|
9014
|
+
break;
|
|
9015
|
+
}
|
|
9016
|
+
message.accountType = reader.string();
|
|
9017
|
+
continue;
|
|
9018
|
+
}
|
|
9019
|
+
}
|
|
9020
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
9021
|
+
break;
|
|
9022
|
+
}
|
|
9023
|
+
reader.skip(tag & 7);
|
|
9024
|
+
}
|
|
9025
|
+
return message;
|
|
9026
|
+
},
|
|
9027
|
+
fromJSON(object) {
|
|
9028
|
+
return {
|
|
9029
|
+
owner: isSet10(object.owner) ? globalThis.String(object.owner) : "",
|
|
9030
|
+
accountType: isSet10(object.accountType) ? globalThis.String(object.accountType) : isSet10(object.account_type) ? globalThis.String(object.account_type) : ""
|
|
9031
|
+
};
|
|
9032
|
+
},
|
|
9033
|
+
toJSON(message) {
|
|
9034
|
+
const obj = {};
|
|
9035
|
+
if (message.owner !== "") {
|
|
9036
|
+
obj.owner = message.owner;
|
|
9037
|
+
}
|
|
9038
|
+
if (message.accountType !== "") {
|
|
9039
|
+
obj.accountType = message.accountType;
|
|
9040
|
+
}
|
|
9041
|
+
return obj;
|
|
9042
|
+
},
|
|
9043
|
+
create(base) {
|
|
9044
|
+
return MsgCreateAbstractAccount.fromPartial(base ?? {});
|
|
9045
|
+
},
|
|
9046
|
+
fromPartial(object) {
|
|
9047
|
+
const message = createBaseMsgCreateAbstractAccount();
|
|
9048
|
+
message.owner = object.owner ?? "";
|
|
9049
|
+
message.accountType = object.accountType ?? "";
|
|
9050
|
+
return message;
|
|
9051
|
+
}
|
|
9052
|
+
};
|
|
9053
|
+
function createBaseMsgCreateAbstractAccountResponse() {
|
|
9054
|
+
return { address: "" };
|
|
9055
|
+
}
|
|
9056
|
+
var MsgCreateAbstractAccountResponse = {
|
|
9057
|
+
encode(message, writer = new BinaryWriter()) {
|
|
9058
|
+
if (message.address !== "") {
|
|
9059
|
+
writer.uint32(10).string(message.address);
|
|
9060
|
+
}
|
|
9061
|
+
return writer;
|
|
9062
|
+
},
|
|
9063
|
+
decode(input, length) {
|
|
9064
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
9065
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
9066
|
+
const message = createBaseMsgCreateAbstractAccountResponse();
|
|
9067
|
+
while (reader.pos < end) {
|
|
9068
|
+
const tag = reader.uint32();
|
|
9069
|
+
switch (tag >>> 3) {
|
|
9070
|
+
case 1: {
|
|
9071
|
+
if (tag !== 10) {
|
|
9072
|
+
break;
|
|
9073
|
+
}
|
|
9074
|
+
message.address = reader.string();
|
|
9075
|
+
continue;
|
|
9076
|
+
}
|
|
9077
|
+
}
|
|
9078
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
9079
|
+
break;
|
|
9080
|
+
}
|
|
9081
|
+
reader.skip(tag & 7);
|
|
9082
|
+
}
|
|
9083
|
+
return message;
|
|
9084
|
+
},
|
|
9085
|
+
fromJSON(object) {
|
|
9086
|
+
return { address: isSet10(object.address) ? globalThis.String(object.address) : "" };
|
|
9087
|
+
},
|
|
9088
|
+
toJSON(message) {
|
|
9089
|
+
const obj = {};
|
|
9090
|
+
if (message.address !== "") {
|
|
9091
|
+
obj.address = message.address;
|
|
9092
|
+
}
|
|
9093
|
+
return obj;
|
|
9094
|
+
},
|
|
9095
|
+
create(base) {
|
|
9096
|
+
return MsgCreateAbstractAccountResponse.fromPartial(base ?? {});
|
|
9097
|
+
},
|
|
9098
|
+
fromPartial(object) {
|
|
9099
|
+
const message = createBaseMsgCreateAbstractAccountResponse();
|
|
9100
|
+
message.address = object.address ?? "";
|
|
9101
|
+
return message;
|
|
9102
|
+
}
|
|
9103
|
+
};
|
|
9104
|
+
function createBaseMsgUpdateSpendingRules() {
|
|
9105
|
+
return { owner: "", accountAddress: "", rules: [] };
|
|
9106
|
+
}
|
|
9107
|
+
var MsgUpdateSpendingRules = {
|
|
9108
|
+
encode(message, writer = new BinaryWriter()) {
|
|
9109
|
+
if (message.owner !== "") {
|
|
9110
|
+
writer.uint32(10).string(message.owner);
|
|
9111
|
+
}
|
|
9112
|
+
if (message.accountAddress !== "") {
|
|
9113
|
+
writer.uint32(18).string(message.accountAddress);
|
|
9114
|
+
}
|
|
9115
|
+
for (const v of message.rules) {
|
|
9116
|
+
SpendingRule.encode(v, writer.uint32(26).fork()).join();
|
|
9117
|
+
}
|
|
9118
|
+
return writer;
|
|
9119
|
+
},
|
|
9120
|
+
decode(input, length) {
|
|
9121
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
9122
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
9123
|
+
const message = createBaseMsgUpdateSpendingRules();
|
|
9124
|
+
while (reader.pos < end) {
|
|
9125
|
+
const tag = reader.uint32();
|
|
9126
|
+
switch (tag >>> 3) {
|
|
9127
|
+
case 1: {
|
|
9128
|
+
if (tag !== 10) {
|
|
9129
|
+
break;
|
|
9130
|
+
}
|
|
9131
|
+
message.owner = reader.string();
|
|
9132
|
+
continue;
|
|
9133
|
+
}
|
|
9134
|
+
case 2: {
|
|
9135
|
+
if (tag !== 18) {
|
|
9136
|
+
break;
|
|
9137
|
+
}
|
|
9138
|
+
message.accountAddress = reader.string();
|
|
9139
|
+
continue;
|
|
9140
|
+
}
|
|
9141
|
+
case 3: {
|
|
9142
|
+
if (tag !== 26) {
|
|
9143
|
+
break;
|
|
9144
|
+
}
|
|
9145
|
+
message.rules.push(SpendingRule.decode(reader, reader.uint32()));
|
|
9146
|
+
continue;
|
|
9147
|
+
}
|
|
9148
|
+
}
|
|
9149
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
9150
|
+
break;
|
|
9151
|
+
}
|
|
9152
|
+
reader.skip(tag & 7);
|
|
9153
|
+
}
|
|
9154
|
+
return message;
|
|
9155
|
+
},
|
|
9156
|
+
fromJSON(object) {
|
|
9157
|
+
return {
|
|
9158
|
+
owner: isSet10(object.owner) ? globalThis.String(object.owner) : "",
|
|
9159
|
+
accountAddress: isSet10(object.accountAddress) ? globalThis.String(object.accountAddress) : isSet10(object.account_address) ? globalThis.String(object.account_address) : "",
|
|
9160
|
+
rules: globalThis.Array.isArray(object?.rules) ? object.rules.map((e) => SpendingRule.fromJSON(e)) : []
|
|
9161
|
+
};
|
|
9162
|
+
},
|
|
9163
|
+
toJSON(message) {
|
|
9164
|
+
const obj = {};
|
|
9165
|
+
if (message.owner !== "") {
|
|
9166
|
+
obj.owner = message.owner;
|
|
9167
|
+
}
|
|
9168
|
+
if (message.accountAddress !== "") {
|
|
9169
|
+
obj.accountAddress = message.accountAddress;
|
|
9170
|
+
}
|
|
9171
|
+
if (message.rules?.length) {
|
|
9172
|
+
obj.rules = message.rules.map((e) => SpendingRule.toJSON(e));
|
|
9173
|
+
}
|
|
9174
|
+
return obj;
|
|
9175
|
+
},
|
|
9176
|
+
create(base) {
|
|
9177
|
+
return MsgUpdateSpendingRules.fromPartial(base ?? {});
|
|
9178
|
+
},
|
|
9179
|
+
fromPartial(object) {
|
|
9180
|
+
const message = createBaseMsgUpdateSpendingRules();
|
|
9181
|
+
message.owner = object.owner ?? "";
|
|
9182
|
+
message.accountAddress = object.accountAddress ?? "";
|
|
9183
|
+
message.rules = object.rules?.map((e) => SpendingRule.fromPartial(e)) || [];
|
|
9184
|
+
return message;
|
|
9185
|
+
}
|
|
9186
|
+
};
|
|
9187
|
+
function createBaseMsgUpdateSpendingRulesResponse() {
|
|
9188
|
+
return {};
|
|
9189
|
+
}
|
|
9190
|
+
var MsgUpdateSpendingRulesResponse = {
|
|
9191
|
+
encode(_, writer = new BinaryWriter()) {
|
|
9192
|
+
return writer;
|
|
9193
|
+
},
|
|
9194
|
+
decode(input, length) {
|
|
9195
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
9196
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
9197
|
+
const message = createBaseMsgUpdateSpendingRulesResponse();
|
|
9198
|
+
while (reader.pos < end) {
|
|
9199
|
+
const tag = reader.uint32();
|
|
9200
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
9201
|
+
break;
|
|
9202
|
+
}
|
|
9203
|
+
reader.skip(tag & 7);
|
|
9204
|
+
}
|
|
9205
|
+
return message;
|
|
9206
|
+
},
|
|
9207
|
+
fromJSON(_) {
|
|
9208
|
+
return {};
|
|
9209
|
+
},
|
|
9210
|
+
toJSON(_) {
|
|
9211
|
+
const obj = {};
|
|
9212
|
+
return obj;
|
|
9213
|
+
},
|
|
9214
|
+
create(base) {
|
|
9215
|
+
return MsgUpdateSpendingRulesResponse.fromPartial(base ?? {});
|
|
9216
|
+
},
|
|
9217
|
+
fromPartial(_) {
|
|
9218
|
+
const message = createBaseMsgUpdateSpendingRulesResponse();
|
|
9219
|
+
return message;
|
|
9220
|
+
}
|
|
9221
|
+
};
|
|
9222
|
+
function createBaseMsgRegisterAuthenticator() {
|
|
9223
|
+
return {
|
|
9224
|
+
owner: "",
|
|
9225
|
+
accountAddress: "",
|
|
9226
|
+
scheme: "",
|
|
9227
|
+
pubkey: new Uint8Array(0),
|
|
9228
|
+
permissions: [],
|
|
9229
|
+
expiryUnix: "0",
|
|
9230
|
+
label: ""
|
|
9231
|
+
};
|
|
9232
|
+
}
|
|
9233
|
+
var MsgRegisterAuthenticator = {
|
|
9234
|
+
encode(message, writer = new BinaryWriter()) {
|
|
9235
|
+
if (message.owner !== "") {
|
|
9236
|
+
writer.uint32(10).string(message.owner);
|
|
9237
|
+
}
|
|
9238
|
+
if (message.accountAddress !== "") {
|
|
9239
|
+
writer.uint32(18).string(message.accountAddress);
|
|
9240
|
+
}
|
|
9241
|
+
if (message.scheme !== "") {
|
|
9242
|
+
writer.uint32(26).string(message.scheme);
|
|
9243
|
+
}
|
|
9244
|
+
if (message.pubkey.length !== 0) {
|
|
9245
|
+
writer.uint32(34).bytes(message.pubkey);
|
|
9246
|
+
}
|
|
9247
|
+
for (const v of message.permissions) {
|
|
9248
|
+
writer.uint32(42).string(v);
|
|
9249
|
+
}
|
|
9250
|
+
if (message.expiryUnix !== "0") {
|
|
9251
|
+
writer.uint32(48).int64(message.expiryUnix);
|
|
9252
|
+
}
|
|
9253
|
+
if (message.label !== "") {
|
|
9254
|
+
writer.uint32(58).string(message.label);
|
|
9255
|
+
}
|
|
9256
|
+
return writer;
|
|
9257
|
+
},
|
|
9258
|
+
decode(input, length) {
|
|
9259
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
9260
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
9261
|
+
const message = createBaseMsgRegisterAuthenticator();
|
|
9262
|
+
while (reader.pos < end) {
|
|
9263
|
+
const tag = reader.uint32();
|
|
9264
|
+
switch (tag >>> 3) {
|
|
9265
|
+
case 1: {
|
|
9266
|
+
if (tag !== 10) {
|
|
9267
|
+
break;
|
|
9268
|
+
}
|
|
9269
|
+
message.owner = reader.string();
|
|
9270
|
+
continue;
|
|
9271
|
+
}
|
|
9272
|
+
case 2: {
|
|
9273
|
+
if (tag !== 18) {
|
|
9274
|
+
break;
|
|
9275
|
+
}
|
|
9276
|
+
message.accountAddress = reader.string();
|
|
9277
|
+
continue;
|
|
9278
|
+
}
|
|
9279
|
+
case 3: {
|
|
9280
|
+
if (tag !== 26) {
|
|
9281
|
+
break;
|
|
9282
|
+
}
|
|
9283
|
+
message.scheme = reader.string();
|
|
9284
|
+
continue;
|
|
9285
|
+
}
|
|
9286
|
+
case 4: {
|
|
9287
|
+
if (tag !== 34) {
|
|
9288
|
+
break;
|
|
9289
|
+
}
|
|
9290
|
+
message.pubkey = reader.bytes();
|
|
8510
9291
|
continue;
|
|
8511
9292
|
}
|
|
8512
|
-
case
|
|
8513
|
-
if (tag !==
|
|
9293
|
+
case 5: {
|
|
9294
|
+
if (tag !== 42) {
|
|
8514
9295
|
break;
|
|
8515
9296
|
}
|
|
8516
|
-
message.
|
|
9297
|
+
message.permissions.push(reader.string());
|
|
9298
|
+
continue;
|
|
9299
|
+
}
|
|
9300
|
+
case 6: {
|
|
9301
|
+
if (tag !== 48) {
|
|
9302
|
+
break;
|
|
9303
|
+
}
|
|
9304
|
+
message.expiryUnix = reader.int64().toString();
|
|
9305
|
+
continue;
|
|
9306
|
+
}
|
|
9307
|
+
case 7: {
|
|
9308
|
+
if (tag !== 58) {
|
|
9309
|
+
break;
|
|
9310
|
+
}
|
|
9311
|
+
message.label = reader.string();
|
|
8517
9312
|
continue;
|
|
8518
9313
|
}
|
|
8519
9314
|
}
|
|
@@ -8527,7 +9322,12 @@ var MsgCreateAbstractAccount = {
|
|
|
8527
9322
|
fromJSON(object) {
|
|
8528
9323
|
return {
|
|
8529
9324
|
owner: isSet10(object.owner) ? globalThis.String(object.owner) : "",
|
|
8530
|
-
|
|
9325
|
+
accountAddress: isSet10(object.accountAddress) ? globalThis.String(object.accountAddress) : isSet10(object.account_address) ? globalThis.String(object.account_address) : "",
|
|
9326
|
+
scheme: isSet10(object.scheme) ? globalThis.String(object.scheme) : "",
|
|
9327
|
+
pubkey: isSet10(object.pubkey) ? bytesFromBase646(object.pubkey) : new Uint8Array(0),
|
|
9328
|
+
permissions: globalThis.Array.isArray(object?.permissions) ? object.permissions.map((e) => globalThis.String(e)) : [],
|
|
9329
|
+
expiryUnix: isSet10(object.expiryUnix) ? globalThis.String(object.expiryUnix) : isSet10(object.expiry_unix) ? globalThis.String(object.expiry_unix) : "0",
|
|
9330
|
+
label: isSet10(object.label) ? globalThis.String(object.label) : ""
|
|
8531
9331
|
};
|
|
8532
9332
|
},
|
|
8533
9333
|
toJSON(message) {
|
|
@@ -8535,46 +9335,54 @@ var MsgCreateAbstractAccount = {
|
|
|
8535
9335
|
if (message.owner !== "") {
|
|
8536
9336
|
obj.owner = message.owner;
|
|
8537
9337
|
}
|
|
8538
|
-
if (message.
|
|
8539
|
-
obj.
|
|
9338
|
+
if (message.accountAddress !== "") {
|
|
9339
|
+
obj.accountAddress = message.accountAddress;
|
|
9340
|
+
}
|
|
9341
|
+
if (message.scheme !== "") {
|
|
9342
|
+
obj.scheme = message.scheme;
|
|
9343
|
+
}
|
|
9344
|
+
if (message.pubkey.length !== 0) {
|
|
9345
|
+
obj.pubkey = base64FromBytes6(message.pubkey);
|
|
9346
|
+
}
|
|
9347
|
+
if (message.permissions?.length) {
|
|
9348
|
+
obj.permissions = message.permissions;
|
|
9349
|
+
}
|
|
9350
|
+
if (message.expiryUnix !== "0") {
|
|
9351
|
+
obj.expiryUnix = message.expiryUnix;
|
|
9352
|
+
}
|
|
9353
|
+
if (message.label !== "") {
|
|
9354
|
+
obj.label = message.label;
|
|
8540
9355
|
}
|
|
8541
9356
|
return obj;
|
|
8542
9357
|
},
|
|
8543
9358
|
create(base) {
|
|
8544
|
-
return
|
|
9359
|
+
return MsgRegisterAuthenticator.fromPartial(base ?? {});
|
|
8545
9360
|
},
|
|
8546
9361
|
fromPartial(object) {
|
|
8547
|
-
const message =
|
|
9362
|
+
const message = createBaseMsgRegisterAuthenticator();
|
|
8548
9363
|
message.owner = object.owner ?? "";
|
|
8549
|
-
message.
|
|
9364
|
+
message.accountAddress = object.accountAddress ?? "";
|
|
9365
|
+
message.scheme = object.scheme ?? "";
|
|
9366
|
+
message.pubkey = object.pubkey ?? new Uint8Array(0);
|
|
9367
|
+
message.permissions = object.permissions?.map((e) => e) || [];
|
|
9368
|
+
message.expiryUnix = object.expiryUnix ?? "0";
|
|
9369
|
+
message.label = object.label ?? "";
|
|
8550
9370
|
return message;
|
|
8551
9371
|
}
|
|
8552
9372
|
};
|
|
8553
|
-
function
|
|
8554
|
-
return {
|
|
9373
|
+
function createBaseMsgRegisterAuthenticatorResponse() {
|
|
9374
|
+
return {};
|
|
8555
9375
|
}
|
|
8556
|
-
var
|
|
8557
|
-
encode(
|
|
8558
|
-
if (message.address !== "") {
|
|
8559
|
-
writer.uint32(10).string(message.address);
|
|
8560
|
-
}
|
|
9376
|
+
var MsgRegisterAuthenticatorResponse = {
|
|
9377
|
+
encode(_, writer = new BinaryWriter()) {
|
|
8561
9378
|
return writer;
|
|
8562
9379
|
},
|
|
8563
9380
|
decode(input, length) {
|
|
8564
9381
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
8565
9382
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8566
|
-
const message =
|
|
9383
|
+
const message = createBaseMsgRegisterAuthenticatorResponse();
|
|
8567
9384
|
while (reader.pos < end) {
|
|
8568
9385
|
const tag = reader.uint32();
|
|
8569
|
-
switch (tag >>> 3) {
|
|
8570
|
-
case 1: {
|
|
8571
|
-
if (tag !== 10) {
|
|
8572
|
-
break;
|
|
8573
|
-
}
|
|
8574
|
-
message.address = reader.string();
|
|
8575
|
-
continue;
|
|
8576
|
-
}
|
|
8577
|
-
}
|
|
8578
9386
|
if ((tag & 7) === 4 || tag === 0) {
|
|
8579
9387
|
break;
|
|
8580
9388
|
}
|
|
@@ -8582,29 +9390,25 @@ var MsgCreateAbstractAccountResponse = {
|
|
|
8582
9390
|
}
|
|
8583
9391
|
return message;
|
|
8584
9392
|
},
|
|
8585
|
-
fromJSON(
|
|
8586
|
-
return {
|
|
9393
|
+
fromJSON(_) {
|
|
9394
|
+
return {};
|
|
8587
9395
|
},
|
|
8588
|
-
toJSON(
|
|
9396
|
+
toJSON(_) {
|
|
8589
9397
|
const obj = {};
|
|
8590
|
-
if (message.address !== "") {
|
|
8591
|
-
obj.address = message.address;
|
|
8592
|
-
}
|
|
8593
9398
|
return obj;
|
|
8594
9399
|
},
|
|
8595
9400
|
create(base) {
|
|
8596
|
-
return
|
|
9401
|
+
return MsgRegisterAuthenticatorResponse.fromPartial(base ?? {});
|
|
8597
9402
|
},
|
|
8598
|
-
fromPartial(
|
|
8599
|
-
const message =
|
|
8600
|
-
message.address = object.address ?? "";
|
|
9403
|
+
fromPartial(_) {
|
|
9404
|
+
const message = createBaseMsgRegisterAuthenticatorResponse();
|
|
8601
9405
|
return message;
|
|
8602
9406
|
}
|
|
8603
9407
|
};
|
|
8604
|
-
function
|
|
8605
|
-
return { owner: "", accountAddress: "",
|
|
9408
|
+
function createBaseMsgRevokeAuthenticator() {
|
|
9409
|
+
return { owner: "", accountAddress: "", scheme: "", pubkey: new Uint8Array(0) };
|
|
8606
9410
|
}
|
|
8607
|
-
var
|
|
9411
|
+
var MsgRevokeAuthenticator = {
|
|
8608
9412
|
encode(message, writer = new BinaryWriter()) {
|
|
8609
9413
|
if (message.owner !== "") {
|
|
8610
9414
|
writer.uint32(10).string(message.owner);
|
|
@@ -8612,15 +9416,18 @@ var MsgUpdateSpendingRules = {
|
|
|
8612
9416
|
if (message.accountAddress !== "") {
|
|
8613
9417
|
writer.uint32(18).string(message.accountAddress);
|
|
8614
9418
|
}
|
|
8615
|
-
|
|
8616
|
-
|
|
9419
|
+
if (message.scheme !== "") {
|
|
9420
|
+
writer.uint32(26).string(message.scheme);
|
|
9421
|
+
}
|
|
9422
|
+
if (message.pubkey.length !== 0) {
|
|
9423
|
+
writer.uint32(34).bytes(message.pubkey);
|
|
8617
9424
|
}
|
|
8618
9425
|
return writer;
|
|
8619
9426
|
},
|
|
8620
9427
|
decode(input, length) {
|
|
8621
9428
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
8622
9429
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8623
|
-
const message =
|
|
9430
|
+
const message = createBaseMsgRevokeAuthenticator();
|
|
8624
9431
|
while (reader.pos < end) {
|
|
8625
9432
|
const tag = reader.uint32();
|
|
8626
9433
|
switch (tag >>> 3) {
|
|
@@ -8642,7 +9449,14 @@ var MsgUpdateSpendingRules = {
|
|
|
8642
9449
|
if (tag !== 26) {
|
|
8643
9450
|
break;
|
|
8644
9451
|
}
|
|
8645
|
-
message.
|
|
9452
|
+
message.scheme = reader.string();
|
|
9453
|
+
continue;
|
|
9454
|
+
}
|
|
9455
|
+
case 4: {
|
|
9456
|
+
if (tag !== 34) {
|
|
9457
|
+
break;
|
|
9458
|
+
}
|
|
9459
|
+
message.pubkey = reader.bytes();
|
|
8646
9460
|
continue;
|
|
8647
9461
|
}
|
|
8648
9462
|
}
|
|
@@ -8657,7 +9471,8 @@ var MsgUpdateSpendingRules = {
|
|
|
8657
9471
|
return {
|
|
8658
9472
|
owner: isSet10(object.owner) ? globalThis.String(object.owner) : "",
|
|
8659
9473
|
accountAddress: isSet10(object.accountAddress) ? globalThis.String(object.accountAddress) : isSet10(object.account_address) ? globalThis.String(object.account_address) : "",
|
|
8660
|
-
|
|
9474
|
+
scheme: isSet10(object.scheme) ? globalThis.String(object.scheme) : "",
|
|
9475
|
+
pubkey: isSet10(object.pubkey) ? bytesFromBase646(object.pubkey) : new Uint8Array(0)
|
|
8661
9476
|
};
|
|
8662
9477
|
},
|
|
8663
9478
|
toJSON(message) {
|
|
@@ -8668,33 +9483,37 @@ var MsgUpdateSpendingRules = {
|
|
|
8668
9483
|
if (message.accountAddress !== "") {
|
|
8669
9484
|
obj.accountAddress = message.accountAddress;
|
|
8670
9485
|
}
|
|
8671
|
-
if (message.
|
|
8672
|
-
obj.
|
|
9486
|
+
if (message.scheme !== "") {
|
|
9487
|
+
obj.scheme = message.scheme;
|
|
9488
|
+
}
|
|
9489
|
+
if (message.pubkey.length !== 0) {
|
|
9490
|
+
obj.pubkey = base64FromBytes6(message.pubkey);
|
|
8673
9491
|
}
|
|
8674
9492
|
return obj;
|
|
8675
9493
|
},
|
|
8676
9494
|
create(base) {
|
|
8677
|
-
return
|
|
9495
|
+
return MsgRevokeAuthenticator.fromPartial(base ?? {});
|
|
8678
9496
|
},
|
|
8679
9497
|
fromPartial(object) {
|
|
8680
|
-
const message =
|
|
9498
|
+
const message = createBaseMsgRevokeAuthenticator();
|
|
8681
9499
|
message.owner = object.owner ?? "";
|
|
8682
9500
|
message.accountAddress = object.accountAddress ?? "";
|
|
8683
|
-
message.
|
|
9501
|
+
message.scheme = object.scheme ?? "";
|
|
9502
|
+
message.pubkey = object.pubkey ?? new Uint8Array(0);
|
|
8684
9503
|
return message;
|
|
8685
9504
|
}
|
|
8686
9505
|
};
|
|
8687
|
-
function
|
|
9506
|
+
function createBaseMsgRevokeAuthenticatorResponse() {
|
|
8688
9507
|
return {};
|
|
8689
9508
|
}
|
|
8690
|
-
var
|
|
9509
|
+
var MsgRevokeAuthenticatorResponse = {
|
|
8691
9510
|
encode(_, writer = new BinaryWriter()) {
|
|
8692
9511
|
return writer;
|
|
8693
9512
|
},
|
|
8694
9513
|
decode(input, length) {
|
|
8695
9514
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
8696
9515
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8697
|
-
const message =
|
|
9516
|
+
const message = createBaseMsgRevokeAuthenticatorResponse();
|
|
8698
9517
|
while (reader.pos < end) {
|
|
8699
9518
|
const tag = reader.uint32();
|
|
8700
9519
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -8712,31 +9531,34 @@ var MsgUpdateSpendingRulesResponse = {
|
|
|
8712
9531
|
return obj;
|
|
8713
9532
|
},
|
|
8714
9533
|
create(base) {
|
|
8715
|
-
return
|
|
9534
|
+
return MsgRevokeAuthenticatorResponse.fromPartial(base ?? {});
|
|
8716
9535
|
},
|
|
8717
9536
|
fromPartial(_) {
|
|
8718
|
-
const message =
|
|
9537
|
+
const message = createBaseMsgRevokeAuthenticatorResponse();
|
|
8719
9538
|
return message;
|
|
8720
9539
|
}
|
|
8721
9540
|
};
|
|
8722
|
-
function
|
|
9541
|
+
function createBaseMsgExecuteEVM() {
|
|
8723
9542
|
return {
|
|
8724
|
-
|
|
8725
|
-
|
|
9543
|
+
relayer: "",
|
|
9544
|
+
account: "",
|
|
8726
9545
|
scheme: "",
|
|
8727
9546
|
pubkey: new Uint8Array(0),
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
9547
|
+
signature: new Uint8Array(0),
|
|
9548
|
+
to: "",
|
|
9549
|
+
value: "",
|
|
9550
|
+
data: new Uint8Array(0),
|
|
9551
|
+
gasLimit: "0",
|
|
9552
|
+
nonce: "0"
|
|
8731
9553
|
};
|
|
8732
9554
|
}
|
|
8733
|
-
var
|
|
9555
|
+
var MsgExecuteEVM = {
|
|
8734
9556
|
encode(message, writer = new BinaryWriter()) {
|
|
8735
|
-
if (message.
|
|
8736
|
-
writer.uint32(10).string(message.
|
|
9557
|
+
if (message.relayer !== "") {
|
|
9558
|
+
writer.uint32(10).string(message.relayer);
|
|
8737
9559
|
}
|
|
8738
|
-
if (message.
|
|
8739
|
-
writer.uint32(18).string(message.
|
|
9560
|
+
if (message.account !== "") {
|
|
9561
|
+
writer.uint32(18).string(message.account);
|
|
8740
9562
|
}
|
|
8741
9563
|
if (message.scheme !== "") {
|
|
8742
9564
|
writer.uint32(26).string(message.scheme);
|
|
@@ -8744,21 +9566,30 @@ var MsgRegisterAuthenticator = {
|
|
|
8744
9566
|
if (message.pubkey.length !== 0) {
|
|
8745
9567
|
writer.uint32(34).bytes(message.pubkey);
|
|
8746
9568
|
}
|
|
8747
|
-
|
|
8748
|
-
writer.uint32(42).
|
|
9569
|
+
if (message.signature.length !== 0) {
|
|
9570
|
+
writer.uint32(42).bytes(message.signature);
|
|
8749
9571
|
}
|
|
8750
|
-
if (message.
|
|
8751
|
-
writer.uint32(
|
|
9572
|
+
if (message.to !== "") {
|
|
9573
|
+
writer.uint32(50).string(message.to);
|
|
8752
9574
|
}
|
|
8753
|
-
if (message.
|
|
8754
|
-
writer.uint32(58).string(message.
|
|
9575
|
+
if (message.value !== "") {
|
|
9576
|
+
writer.uint32(58).string(message.value);
|
|
9577
|
+
}
|
|
9578
|
+
if (message.data.length !== 0) {
|
|
9579
|
+
writer.uint32(66).bytes(message.data);
|
|
9580
|
+
}
|
|
9581
|
+
if (message.gasLimit !== "0") {
|
|
9582
|
+
writer.uint32(72).uint64(message.gasLimit);
|
|
9583
|
+
}
|
|
9584
|
+
if (message.nonce !== "0") {
|
|
9585
|
+
writer.uint32(80).uint64(message.nonce);
|
|
8755
9586
|
}
|
|
8756
9587
|
return writer;
|
|
8757
9588
|
},
|
|
8758
9589
|
decode(input, length) {
|
|
8759
9590
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
8760
9591
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8761
|
-
const message =
|
|
9592
|
+
const message = createBaseMsgExecuteEVM();
|
|
8762
9593
|
while (reader.pos < end) {
|
|
8763
9594
|
const tag = reader.uint32();
|
|
8764
9595
|
switch (tag >>> 3) {
|
|
@@ -8766,14 +9597,14 @@ var MsgRegisterAuthenticator = {
|
|
|
8766
9597
|
if (tag !== 10) {
|
|
8767
9598
|
break;
|
|
8768
9599
|
}
|
|
8769
|
-
message.
|
|
9600
|
+
message.relayer = reader.string();
|
|
8770
9601
|
continue;
|
|
8771
9602
|
}
|
|
8772
9603
|
case 2: {
|
|
8773
9604
|
if (tag !== 18) {
|
|
8774
9605
|
break;
|
|
8775
9606
|
}
|
|
8776
|
-
message.
|
|
9607
|
+
message.account = reader.string();
|
|
8777
9608
|
continue;
|
|
8778
9609
|
}
|
|
8779
9610
|
case 3: {
|
|
@@ -8794,21 +9625,42 @@ var MsgRegisterAuthenticator = {
|
|
|
8794
9625
|
if (tag !== 42) {
|
|
8795
9626
|
break;
|
|
8796
9627
|
}
|
|
8797
|
-
message.
|
|
9628
|
+
message.signature = reader.bytes();
|
|
8798
9629
|
continue;
|
|
8799
9630
|
}
|
|
8800
9631
|
case 6: {
|
|
8801
|
-
if (tag !==
|
|
9632
|
+
if (tag !== 50) {
|
|
8802
9633
|
break;
|
|
8803
9634
|
}
|
|
8804
|
-
message.
|
|
9635
|
+
message.to = reader.string();
|
|
8805
9636
|
continue;
|
|
8806
9637
|
}
|
|
8807
9638
|
case 7: {
|
|
8808
9639
|
if (tag !== 58) {
|
|
8809
9640
|
break;
|
|
8810
9641
|
}
|
|
8811
|
-
message.
|
|
9642
|
+
message.value = reader.string();
|
|
9643
|
+
continue;
|
|
9644
|
+
}
|
|
9645
|
+
case 8: {
|
|
9646
|
+
if (tag !== 66) {
|
|
9647
|
+
break;
|
|
9648
|
+
}
|
|
9649
|
+
message.data = reader.bytes();
|
|
9650
|
+
continue;
|
|
9651
|
+
}
|
|
9652
|
+
case 9: {
|
|
9653
|
+
if (tag !== 72) {
|
|
9654
|
+
break;
|
|
9655
|
+
}
|
|
9656
|
+
message.gasLimit = reader.uint64().toString();
|
|
9657
|
+
continue;
|
|
9658
|
+
}
|
|
9659
|
+
case 10: {
|
|
9660
|
+
if (tag !== 80) {
|
|
9661
|
+
break;
|
|
9662
|
+
}
|
|
9663
|
+
message.nonce = reader.uint64().toString();
|
|
8812
9664
|
continue;
|
|
8813
9665
|
}
|
|
8814
9666
|
}
|
|
@@ -8821,22 +9673,25 @@ var MsgRegisterAuthenticator = {
|
|
|
8821
9673
|
},
|
|
8822
9674
|
fromJSON(object) {
|
|
8823
9675
|
return {
|
|
8824
|
-
|
|
8825
|
-
|
|
9676
|
+
relayer: isSet10(object.relayer) ? globalThis.String(object.relayer) : "",
|
|
9677
|
+
account: isSet10(object.account) ? globalThis.String(object.account) : "",
|
|
8826
9678
|
scheme: isSet10(object.scheme) ? globalThis.String(object.scheme) : "",
|
|
8827
9679
|
pubkey: isSet10(object.pubkey) ? bytesFromBase646(object.pubkey) : new Uint8Array(0),
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
9680
|
+
signature: isSet10(object.signature) ? bytesFromBase646(object.signature) : new Uint8Array(0),
|
|
9681
|
+
to: isSet10(object.to) ? globalThis.String(object.to) : "",
|
|
9682
|
+
value: isSet10(object.value) ? globalThis.String(object.value) : "",
|
|
9683
|
+
data: isSet10(object.data) ? bytesFromBase646(object.data) : new Uint8Array(0),
|
|
9684
|
+
gasLimit: isSet10(object.gasLimit) ? globalThis.String(object.gasLimit) : isSet10(object.gas_limit) ? globalThis.String(object.gas_limit) : "0",
|
|
9685
|
+
nonce: isSet10(object.nonce) ? globalThis.String(object.nonce) : "0"
|
|
8831
9686
|
};
|
|
8832
9687
|
},
|
|
8833
9688
|
toJSON(message) {
|
|
8834
9689
|
const obj = {};
|
|
8835
|
-
if (message.
|
|
8836
|
-
obj.
|
|
9690
|
+
if (message.relayer !== "") {
|
|
9691
|
+
obj.relayer = message.relayer;
|
|
8837
9692
|
}
|
|
8838
|
-
if (message.
|
|
8839
|
-
obj.
|
|
9693
|
+
if (message.account !== "") {
|
|
9694
|
+
obj.account = message.account;
|
|
8840
9695
|
}
|
|
8841
9696
|
if (message.scheme !== "") {
|
|
8842
9697
|
obj.scheme = message.scheme;
|
|
@@ -8844,45 +9699,99 @@ var MsgRegisterAuthenticator = {
|
|
|
8844
9699
|
if (message.pubkey.length !== 0) {
|
|
8845
9700
|
obj.pubkey = base64FromBytes6(message.pubkey);
|
|
8846
9701
|
}
|
|
8847
|
-
if (message.
|
|
8848
|
-
obj.
|
|
9702
|
+
if (message.signature.length !== 0) {
|
|
9703
|
+
obj.signature = base64FromBytes6(message.signature);
|
|
8849
9704
|
}
|
|
8850
|
-
if (message.
|
|
8851
|
-
obj.
|
|
9705
|
+
if (message.to !== "") {
|
|
9706
|
+
obj.to = message.to;
|
|
8852
9707
|
}
|
|
8853
|
-
if (message.
|
|
8854
|
-
obj.
|
|
9708
|
+
if (message.value !== "") {
|
|
9709
|
+
obj.value = message.value;
|
|
9710
|
+
}
|
|
9711
|
+
if (message.data.length !== 0) {
|
|
9712
|
+
obj.data = base64FromBytes6(message.data);
|
|
9713
|
+
}
|
|
9714
|
+
if (message.gasLimit !== "0") {
|
|
9715
|
+
obj.gasLimit = message.gasLimit;
|
|
9716
|
+
}
|
|
9717
|
+
if (message.nonce !== "0") {
|
|
9718
|
+
obj.nonce = message.nonce;
|
|
8855
9719
|
}
|
|
8856
9720
|
return obj;
|
|
8857
9721
|
},
|
|
8858
9722
|
create(base) {
|
|
8859
|
-
return
|
|
9723
|
+
return MsgExecuteEVM.fromPartial(base ?? {});
|
|
8860
9724
|
},
|
|
8861
9725
|
fromPartial(object) {
|
|
8862
|
-
const message =
|
|
8863
|
-
message.
|
|
8864
|
-
message.
|
|
9726
|
+
const message = createBaseMsgExecuteEVM();
|
|
9727
|
+
message.relayer = object.relayer ?? "";
|
|
9728
|
+
message.account = object.account ?? "";
|
|
8865
9729
|
message.scheme = object.scheme ?? "";
|
|
8866
9730
|
message.pubkey = object.pubkey ?? new Uint8Array(0);
|
|
8867
|
-
message.
|
|
8868
|
-
message.
|
|
8869
|
-
message.
|
|
9731
|
+
message.signature = object.signature ?? new Uint8Array(0);
|
|
9732
|
+
message.to = object.to ?? "";
|
|
9733
|
+
message.value = object.value ?? "";
|
|
9734
|
+
message.data = object.data ?? new Uint8Array(0);
|
|
9735
|
+
message.gasLimit = object.gasLimit ?? "0";
|
|
9736
|
+
message.nonce = object.nonce ?? "0";
|
|
8870
9737
|
return message;
|
|
8871
9738
|
}
|
|
8872
9739
|
};
|
|
8873
|
-
function
|
|
8874
|
-
return {};
|
|
9740
|
+
function createBaseMsgExecuteEVMResponse() {
|
|
9741
|
+
return { success: false, ret: new Uint8Array(0), gasUsed: "0", vmError: "" };
|
|
8875
9742
|
}
|
|
8876
|
-
var
|
|
8877
|
-
encode(
|
|
9743
|
+
var MsgExecuteEVMResponse = {
|
|
9744
|
+
encode(message, writer = new BinaryWriter()) {
|
|
9745
|
+
if (message.success !== false) {
|
|
9746
|
+
writer.uint32(8).bool(message.success);
|
|
9747
|
+
}
|
|
9748
|
+
if (message.ret.length !== 0) {
|
|
9749
|
+
writer.uint32(18).bytes(message.ret);
|
|
9750
|
+
}
|
|
9751
|
+
if (message.gasUsed !== "0") {
|
|
9752
|
+
writer.uint32(24).uint64(message.gasUsed);
|
|
9753
|
+
}
|
|
9754
|
+
if (message.vmError !== "") {
|
|
9755
|
+
writer.uint32(34).string(message.vmError);
|
|
9756
|
+
}
|
|
8878
9757
|
return writer;
|
|
8879
9758
|
},
|
|
8880
9759
|
decode(input, length) {
|
|
8881
9760
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
8882
9761
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8883
|
-
const message =
|
|
9762
|
+
const message = createBaseMsgExecuteEVMResponse();
|
|
8884
9763
|
while (reader.pos < end) {
|
|
8885
9764
|
const tag = reader.uint32();
|
|
9765
|
+
switch (tag >>> 3) {
|
|
9766
|
+
case 1: {
|
|
9767
|
+
if (tag !== 8) {
|
|
9768
|
+
break;
|
|
9769
|
+
}
|
|
9770
|
+
message.success = reader.bool();
|
|
9771
|
+
continue;
|
|
9772
|
+
}
|
|
9773
|
+
case 2: {
|
|
9774
|
+
if (tag !== 18) {
|
|
9775
|
+
break;
|
|
9776
|
+
}
|
|
9777
|
+
message.ret = reader.bytes();
|
|
9778
|
+
continue;
|
|
9779
|
+
}
|
|
9780
|
+
case 3: {
|
|
9781
|
+
if (tag !== 24) {
|
|
9782
|
+
break;
|
|
9783
|
+
}
|
|
9784
|
+
message.gasUsed = reader.uint64().toString();
|
|
9785
|
+
continue;
|
|
9786
|
+
}
|
|
9787
|
+
case 4: {
|
|
9788
|
+
if (tag !== 34) {
|
|
9789
|
+
break;
|
|
9790
|
+
}
|
|
9791
|
+
message.vmError = reader.string();
|
|
9792
|
+
continue;
|
|
9793
|
+
}
|
|
9794
|
+
}
|
|
8886
9795
|
if ((tag & 7) === 4 || tag === 0) {
|
|
8887
9796
|
break;
|
|
8888
9797
|
}
|
|
@@ -8890,31 +9799,61 @@ var MsgRegisterAuthenticatorResponse = {
|
|
|
8890
9799
|
}
|
|
8891
9800
|
return message;
|
|
8892
9801
|
},
|
|
8893
|
-
fromJSON(
|
|
8894
|
-
return {
|
|
9802
|
+
fromJSON(object) {
|
|
9803
|
+
return {
|
|
9804
|
+
success: isSet10(object.success) ? globalThis.Boolean(object.success) : false,
|
|
9805
|
+
ret: isSet10(object.ret) ? bytesFromBase646(object.ret) : new Uint8Array(0),
|
|
9806
|
+
gasUsed: isSet10(object.gasUsed) ? globalThis.String(object.gasUsed) : isSet10(object.gas_used) ? globalThis.String(object.gas_used) : "0",
|
|
9807
|
+
vmError: isSet10(object.vmError) ? globalThis.String(object.vmError) : isSet10(object.vm_error) ? globalThis.String(object.vm_error) : ""
|
|
9808
|
+
};
|
|
8895
9809
|
},
|
|
8896
|
-
toJSON(
|
|
9810
|
+
toJSON(message) {
|
|
8897
9811
|
const obj = {};
|
|
9812
|
+
if (message.success !== false) {
|
|
9813
|
+
obj.success = message.success;
|
|
9814
|
+
}
|
|
9815
|
+
if (message.ret.length !== 0) {
|
|
9816
|
+
obj.ret = base64FromBytes6(message.ret);
|
|
9817
|
+
}
|
|
9818
|
+
if (message.gasUsed !== "0") {
|
|
9819
|
+
obj.gasUsed = message.gasUsed;
|
|
9820
|
+
}
|
|
9821
|
+
if (message.vmError !== "") {
|
|
9822
|
+
obj.vmError = message.vmError;
|
|
9823
|
+
}
|
|
8898
9824
|
return obj;
|
|
8899
9825
|
},
|
|
8900
9826
|
create(base) {
|
|
8901
|
-
return
|
|
9827
|
+
return MsgExecuteEVMResponse.fromPartial(base ?? {});
|
|
8902
9828
|
},
|
|
8903
|
-
fromPartial(
|
|
8904
|
-
const message =
|
|
9829
|
+
fromPartial(object) {
|
|
9830
|
+
const message = createBaseMsgExecuteEVMResponse();
|
|
9831
|
+
message.success = object.success ?? false;
|
|
9832
|
+
message.ret = object.ret ?? new Uint8Array(0);
|
|
9833
|
+
message.gasUsed = object.gasUsed ?? "0";
|
|
9834
|
+
message.vmError = object.vmError ?? "";
|
|
8905
9835
|
return message;
|
|
8906
9836
|
}
|
|
8907
9837
|
};
|
|
8908
|
-
function
|
|
8909
|
-
return {
|
|
9838
|
+
function createBaseMsgExecuteCosmos() {
|
|
9839
|
+
return {
|
|
9840
|
+
relayer: "",
|
|
9841
|
+
account: "",
|
|
9842
|
+
scheme: "",
|
|
9843
|
+
pubkey: new Uint8Array(0),
|
|
9844
|
+
signature: new Uint8Array(0),
|
|
9845
|
+
to: "",
|
|
9846
|
+
amount: [],
|
|
9847
|
+
nonce: "0"
|
|
9848
|
+
};
|
|
8910
9849
|
}
|
|
8911
|
-
var
|
|
9850
|
+
var MsgExecuteCosmos = {
|
|
8912
9851
|
encode(message, writer = new BinaryWriter()) {
|
|
8913
|
-
if (message.
|
|
8914
|
-
writer.uint32(10).string(message.
|
|
9852
|
+
if (message.relayer !== "") {
|
|
9853
|
+
writer.uint32(10).string(message.relayer);
|
|
8915
9854
|
}
|
|
8916
|
-
if (message.
|
|
8917
|
-
writer.uint32(18).string(message.
|
|
9855
|
+
if (message.account !== "") {
|
|
9856
|
+
writer.uint32(18).string(message.account);
|
|
8918
9857
|
}
|
|
8919
9858
|
if (message.scheme !== "") {
|
|
8920
9859
|
writer.uint32(26).string(message.scheme);
|
|
@@ -8922,12 +9861,24 @@ var MsgRevokeAuthenticator = {
|
|
|
8922
9861
|
if (message.pubkey.length !== 0) {
|
|
8923
9862
|
writer.uint32(34).bytes(message.pubkey);
|
|
8924
9863
|
}
|
|
9864
|
+
if (message.signature.length !== 0) {
|
|
9865
|
+
writer.uint32(42).bytes(message.signature);
|
|
9866
|
+
}
|
|
9867
|
+
if (message.to !== "") {
|
|
9868
|
+
writer.uint32(50).string(message.to);
|
|
9869
|
+
}
|
|
9870
|
+
for (const v of message.amount) {
|
|
9871
|
+
Coin.encode(v, writer.uint32(58).fork()).join();
|
|
9872
|
+
}
|
|
9873
|
+
if (message.nonce !== "0") {
|
|
9874
|
+
writer.uint32(64).uint64(message.nonce);
|
|
9875
|
+
}
|
|
8925
9876
|
return writer;
|
|
8926
9877
|
},
|
|
8927
9878
|
decode(input, length) {
|
|
8928
9879
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
8929
9880
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
8930
|
-
const message =
|
|
9881
|
+
const message = createBaseMsgExecuteCosmos();
|
|
8931
9882
|
while (reader.pos < end) {
|
|
8932
9883
|
const tag = reader.uint32();
|
|
8933
9884
|
switch (tag >>> 3) {
|
|
@@ -8935,14 +9886,14 @@ var MsgRevokeAuthenticator = {
|
|
|
8935
9886
|
if (tag !== 10) {
|
|
8936
9887
|
break;
|
|
8937
9888
|
}
|
|
8938
|
-
message.
|
|
9889
|
+
message.relayer = reader.string();
|
|
8939
9890
|
continue;
|
|
8940
9891
|
}
|
|
8941
9892
|
case 2: {
|
|
8942
9893
|
if (tag !== 18) {
|
|
8943
9894
|
break;
|
|
8944
9895
|
}
|
|
8945
|
-
message.
|
|
9896
|
+
message.account = reader.string();
|
|
8946
9897
|
continue;
|
|
8947
9898
|
}
|
|
8948
9899
|
case 3: {
|
|
@@ -8959,6 +9910,34 @@ var MsgRevokeAuthenticator = {
|
|
|
8959
9910
|
message.pubkey = reader.bytes();
|
|
8960
9911
|
continue;
|
|
8961
9912
|
}
|
|
9913
|
+
case 5: {
|
|
9914
|
+
if (tag !== 42) {
|
|
9915
|
+
break;
|
|
9916
|
+
}
|
|
9917
|
+
message.signature = reader.bytes();
|
|
9918
|
+
continue;
|
|
9919
|
+
}
|
|
9920
|
+
case 6: {
|
|
9921
|
+
if (tag !== 50) {
|
|
9922
|
+
break;
|
|
9923
|
+
}
|
|
9924
|
+
message.to = reader.string();
|
|
9925
|
+
continue;
|
|
9926
|
+
}
|
|
9927
|
+
case 7: {
|
|
9928
|
+
if (tag !== 58) {
|
|
9929
|
+
break;
|
|
9930
|
+
}
|
|
9931
|
+
message.amount.push(Coin.decode(reader, reader.uint32()));
|
|
9932
|
+
continue;
|
|
9933
|
+
}
|
|
9934
|
+
case 8: {
|
|
9935
|
+
if (tag !== 64) {
|
|
9936
|
+
break;
|
|
9937
|
+
}
|
|
9938
|
+
message.nonce = reader.uint64().toString();
|
|
9939
|
+
continue;
|
|
9940
|
+
}
|
|
8962
9941
|
}
|
|
8963
9942
|
if ((tag & 7) === 4 || tag === 0) {
|
|
8964
9943
|
break;
|
|
@@ -8969,19 +9948,23 @@ var MsgRevokeAuthenticator = {
|
|
|
8969
9948
|
},
|
|
8970
9949
|
fromJSON(object) {
|
|
8971
9950
|
return {
|
|
8972
|
-
|
|
8973
|
-
|
|
9951
|
+
relayer: isSet10(object.relayer) ? globalThis.String(object.relayer) : "",
|
|
9952
|
+
account: isSet10(object.account) ? globalThis.String(object.account) : "",
|
|
8974
9953
|
scheme: isSet10(object.scheme) ? globalThis.String(object.scheme) : "",
|
|
8975
|
-
pubkey: isSet10(object.pubkey) ? bytesFromBase646(object.pubkey) : new Uint8Array(0)
|
|
9954
|
+
pubkey: isSet10(object.pubkey) ? bytesFromBase646(object.pubkey) : new Uint8Array(0),
|
|
9955
|
+
signature: isSet10(object.signature) ? bytesFromBase646(object.signature) : new Uint8Array(0),
|
|
9956
|
+
to: isSet10(object.to) ? globalThis.String(object.to) : "",
|
|
9957
|
+
amount: globalThis.Array.isArray(object?.amount) ? object.amount.map((e) => Coin.fromJSON(e)) : [],
|
|
9958
|
+
nonce: isSet10(object.nonce) ? globalThis.String(object.nonce) : "0"
|
|
8976
9959
|
};
|
|
8977
9960
|
},
|
|
8978
9961
|
toJSON(message) {
|
|
8979
9962
|
const obj = {};
|
|
8980
|
-
if (message.
|
|
8981
|
-
obj.
|
|
9963
|
+
if (message.relayer !== "") {
|
|
9964
|
+
obj.relayer = message.relayer;
|
|
8982
9965
|
}
|
|
8983
|
-
if (message.
|
|
8984
|
-
obj.
|
|
9966
|
+
if (message.account !== "") {
|
|
9967
|
+
obj.account = message.account;
|
|
8985
9968
|
}
|
|
8986
9969
|
if (message.scheme !== "") {
|
|
8987
9970
|
obj.scheme = message.scheme;
|
|
@@ -8989,33 +9972,61 @@ var MsgRevokeAuthenticator = {
|
|
|
8989
9972
|
if (message.pubkey.length !== 0) {
|
|
8990
9973
|
obj.pubkey = base64FromBytes6(message.pubkey);
|
|
8991
9974
|
}
|
|
9975
|
+
if (message.signature.length !== 0) {
|
|
9976
|
+
obj.signature = base64FromBytes6(message.signature);
|
|
9977
|
+
}
|
|
9978
|
+
if (message.to !== "") {
|
|
9979
|
+
obj.to = message.to;
|
|
9980
|
+
}
|
|
9981
|
+
if (message.amount?.length) {
|
|
9982
|
+
obj.amount = message.amount.map((e) => Coin.toJSON(e));
|
|
9983
|
+
}
|
|
9984
|
+
if (message.nonce !== "0") {
|
|
9985
|
+
obj.nonce = message.nonce;
|
|
9986
|
+
}
|
|
8992
9987
|
return obj;
|
|
8993
9988
|
},
|
|
8994
9989
|
create(base) {
|
|
8995
|
-
return
|
|
9990
|
+
return MsgExecuteCosmos.fromPartial(base ?? {});
|
|
8996
9991
|
},
|
|
8997
9992
|
fromPartial(object) {
|
|
8998
|
-
const message =
|
|
8999
|
-
message.
|
|
9000
|
-
message.
|
|
9993
|
+
const message = createBaseMsgExecuteCosmos();
|
|
9994
|
+
message.relayer = object.relayer ?? "";
|
|
9995
|
+
message.account = object.account ?? "";
|
|
9001
9996
|
message.scheme = object.scheme ?? "";
|
|
9002
9997
|
message.pubkey = object.pubkey ?? new Uint8Array(0);
|
|
9998
|
+
message.signature = object.signature ?? new Uint8Array(0);
|
|
9999
|
+
message.to = object.to ?? "";
|
|
10000
|
+
message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [];
|
|
10001
|
+
message.nonce = object.nonce ?? "0";
|
|
9003
10002
|
return message;
|
|
9004
10003
|
}
|
|
9005
10004
|
};
|
|
9006
|
-
function
|
|
9007
|
-
return {};
|
|
10005
|
+
function createBaseMsgExecuteCosmosResponse() {
|
|
10006
|
+
return { success: false };
|
|
9008
10007
|
}
|
|
9009
|
-
var
|
|
9010
|
-
encode(
|
|
10008
|
+
var MsgExecuteCosmosResponse = {
|
|
10009
|
+
encode(message, writer = new BinaryWriter()) {
|
|
10010
|
+
if (message.success !== false) {
|
|
10011
|
+
writer.uint32(8).bool(message.success);
|
|
10012
|
+
}
|
|
9011
10013
|
return writer;
|
|
9012
10014
|
},
|
|
9013
10015
|
decode(input, length) {
|
|
9014
10016
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
9015
10017
|
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
9016
|
-
const message =
|
|
10018
|
+
const message = createBaseMsgExecuteCosmosResponse();
|
|
9017
10019
|
while (reader.pos < end) {
|
|
9018
10020
|
const tag = reader.uint32();
|
|
10021
|
+
switch (tag >>> 3) {
|
|
10022
|
+
case 1: {
|
|
10023
|
+
if (tag !== 8) {
|
|
10024
|
+
break;
|
|
10025
|
+
}
|
|
10026
|
+
message.success = reader.bool();
|
|
10027
|
+
continue;
|
|
10028
|
+
}
|
|
10029
|
+
}
|
|
9019
10030
|
if ((tag & 7) === 4 || tag === 0) {
|
|
9020
10031
|
break;
|
|
9021
10032
|
}
|
|
@@ -9023,18 +10034,22 @@ var MsgRevokeAuthenticatorResponse = {
|
|
|
9023
10034
|
}
|
|
9024
10035
|
return message;
|
|
9025
10036
|
},
|
|
9026
|
-
fromJSON(
|
|
9027
|
-
return {};
|
|
10037
|
+
fromJSON(object) {
|
|
10038
|
+
return { success: isSet10(object.success) ? globalThis.Boolean(object.success) : false };
|
|
9028
10039
|
},
|
|
9029
|
-
toJSON(
|
|
10040
|
+
toJSON(message) {
|
|
9030
10041
|
const obj = {};
|
|
10042
|
+
if (message.success !== false) {
|
|
10043
|
+
obj.success = message.success;
|
|
10044
|
+
}
|
|
9031
10045
|
return obj;
|
|
9032
10046
|
},
|
|
9033
10047
|
create(base) {
|
|
9034
|
-
return
|
|
10048
|
+
return MsgExecuteCosmosResponse.fromPartial(base ?? {});
|
|
9035
10049
|
},
|
|
9036
|
-
fromPartial(
|
|
9037
|
-
const message =
|
|
10050
|
+
fromPartial(object) {
|
|
10051
|
+
const message = createBaseMsgExecuteCosmosResponse();
|
|
10052
|
+
message.success = object.success ?? false;
|
|
9038
10053
|
return message;
|
|
9039
10054
|
}
|
|
9040
10055
|
};
|
|
@@ -9073,6 +10088,22 @@ var MsgDefinition9 = {
|
|
|
9073
10088
|
responseType: MsgRevokeAuthenticatorResponse,
|
|
9074
10089
|
responseStream: false,
|
|
9075
10090
|
options: {}
|
|
10091
|
+
},
|
|
10092
|
+
executeEVM: {
|
|
10093
|
+
name: "ExecuteEVM",
|
|
10094
|
+
requestType: MsgExecuteEVM,
|
|
10095
|
+
requestStream: false,
|
|
10096
|
+
responseType: MsgExecuteEVMResponse,
|
|
10097
|
+
responseStream: false,
|
|
10098
|
+
options: {}
|
|
10099
|
+
},
|
|
10100
|
+
executeCosmos: {
|
|
10101
|
+
name: "ExecuteCosmos",
|
|
10102
|
+
requestType: MsgExecuteCosmos,
|
|
10103
|
+
requestStream: false,
|
|
10104
|
+
responseType: MsgExecuteCosmosResponse,
|
|
10105
|
+
responseStream: false,
|
|
10106
|
+
options: {}
|
|
9076
10107
|
}
|
|
9077
10108
|
}
|
|
9078
10109
|
};
|
|
@@ -9115,7 +10146,15 @@ __export(tx_exports10, {
|
|
|
9115
10146
|
});
|
|
9116
10147
|
var protobufPackage10 = "qorechain.crossvm.v1";
|
|
9117
10148
|
function createBaseMsgCrossVMCall() {
|
|
9118
|
-
return {
|
|
10149
|
+
return {
|
|
10150
|
+
sender: "",
|
|
10151
|
+
sourceVm: "",
|
|
10152
|
+
targetVm: "",
|
|
10153
|
+
targetContract: "",
|
|
10154
|
+
payload: new Uint8Array(0),
|
|
10155
|
+
funds: [],
|
|
10156
|
+
async: false
|
|
10157
|
+
};
|
|
9119
10158
|
}
|
|
9120
10159
|
var MsgCrossVMCall = {
|
|
9121
10160
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -9137,6 +10176,9 @@ var MsgCrossVMCall = {
|
|
|
9137
10176
|
for (const v of message.funds) {
|
|
9138
10177
|
Coin.encode(v, writer.uint32(50).fork()).join();
|
|
9139
10178
|
}
|
|
10179
|
+
if (message.async !== false) {
|
|
10180
|
+
writer.uint32(56).bool(message.async);
|
|
10181
|
+
}
|
|
9140
10182
|
return writer;
|
|
9141
10183
|
},
|
|
9142
10184
|
decode(input, length) {
|
|
@@ -9188,6 +10230,13 @@ var MsgCrossVMCall = {
|
|
|
9188
10230
|
message.funds.push(Coin.decode(reader, reader.uint32()));
|
|
9189
10231
|
continue;
|
|
9190
10232
|
}
|
|
10233
|
+
case 7: {
|
|
10234
|
+
if (tag !== 56) {
|
|
10235
|
+
break;
|
|
10236
|
+
}
|
|
10237
|
+
message.async = reader.bool();
|
|
10238
|
+
continue;
|
|
10239
|
+
}
|
|
9191
10240
|
}
|
|
9192
10241
|
if ((tag & 7) === 4 || tag === 0) {
|
|
9193
10242
|
break;
|
|
@@ -9203,7 +10252,8 @@ var MsgCrossVMCall = {
|
|
|
9203
10252
|
targetVm: isSet11(object.targetVm) ? globalThis.String(object.targetVm) : isSet11(object.target_vm) ? globalThis.String(object.target_vm) : "",
|
|
9204
10253
|
targetContract: isSet11(object.targetContract) ? globalThis.String(object.targetContract) : isSet11(object.target_contract) ? globalThis.String(object.target_contract) : "",
|
|
9205
10254
|
payload: isSet11(object.payload) ? bytesFromBase647(object.payload) : new Uint8Array(0),
|
|
9206
|
-
funds: globalThis.Array.isArray(object?.funds) ? object.funds.map((e) => Coin.fromJSON(e)) : []
|
|
10255
|
+
funds: globalThis.Array.isArray(object?.funds) ? object.funds.map((e) => Coin.fromJSON(e)) : [],
|
|
10256
|
+
async: isSet11(object.async) ? globalThis.Boolean(object.async) : false
|
|
9207
10257
|
};
|
|
9208
10258
|
},
|
|
9209
10259
|
toJSON(message) {
|
|
@@ -9226,6 +10276,9 @@ var MsgCrossVMCall = {
|
|
|
9226
10276
|
if (message.funds?.length) {
|
|
9227
10277
|
obj.funds = message.funds.map((e) => Coin.toJSON(e));
|
|
9228
10278
|
}
|
|
10279
|
+
if (message.async !== false) {
|
|
10280
|
+
obj.async = message.async;
|
|
10281
|
+
}
|
|
9229
10282
|
return obj;
|
|
9230
10283
|
},
|
|
9231
10284
|
create(base) {
|
|
@@ -9239,17 +10292,27 @@ var MsgCrossVMCall = {
|
|
|
9239
10292
|
message.targetContract = object.targetContract ?? "";
|
|
9240
10293
|
message.payload = object.payload ?? new Uint8Array(0);
|
|
9241
10294
|
message.funds = object.funds?.map((e) => Coin.fromPartial(e)) || [];
|
|
10295
|
+
message.async = object.async ?? false;
|
|
9242
10296
|
return message;
|
|
9243
10297
|
}
|
|
9244
10298
|
};
|
|
9245
10299
|
function createBaseMsgCrossVMCallResponse() {
|
|
9246
|
-
return { messageId: "" };
|
|
10300
|
+
return { messageId: "", executed: false, data: new Uint8Array(0), gasUsed: "0" };
|
|
9247
10301
|
}
|
|
9248
10302
|
var MsgCrossVMCallResponse = {
|
|
9249
10303
|
encode(message, writer = new BinaryWriter()) {
|
|
9250
10304
|
if (message.messageId !== "") {
|
|
9251
10305
|
writer.uint32(10).string(message.messageId);
|
|
9252
10306
|
}
|
|
10307
|
+
if (message.executed !== false) {
|
|
10308
|
+
writer.uint32(16).bool(message.executed);
|
|
10309
|
+
}
|
|
10310
|
+
if (message.data.length !== 0) {
|
|
10311
|
+
writer.uint32(26).bytes(message.data);
|
|
10312
|
+
}
|
|
10313
|
+
if (message.gasUsed !== "0") {
|
|
10314
|
+
writer.uint32(32).uint64(message.gasUsed);
|
|
10315
|
+
}
|
|
9253
10316
|
return writer;
|
|
9254
10317
|
},
|
|
9255
10318
|
decode(input, length) {
|
|
@@ -9266,6 +10329,27 @@ var MsgCrossVMCallResponse = {
|
|
|
9266
10329
|
message.messageId = reader.string();
|
|
9267
10330
|
continue;
|
|
9268
10331
|
}
|
|
10332
|
+
case 2: {
|
|
10333
|
+
if (tag !== 16) {
|
|
10334
|
+
break;
|
|
10335
|
+
}
|
|
10336
|
+
message.executed = reader.bool();
|
|
10337
|
+
continue;
|
|
10338
|
+
}
|
|
10339
|
+
case 3: {
|
|
10340
|
+
if (tag !== 26) {
|
|
10341
|
+
break;
|
|
10342
|
+
}
|
|
10343
|
+
message.data = reader.bytes();
|
|
10344
|
+
continue;
|
|
10345
|
+
}
|
|
10346
|
+
case 4: {
|
|
10347
|
+
if (tag !== 32) {
|
|
10348
|
+
break;
|
|
10349
|
+
}
|
|
10350
|
+
message.gasUsed = reader.uint64().toString();
|
|
10351
|
+
continue;
|
|
10352
|
+
}
|
|
9269
10353
|
}
|
|
9270
10354
|
if ((tag & 7) === 4 || tag === 0) {
|
|
9271
10355
|
break;
|
|
@@ -9276,7 +10360,10 @@ var MsgCrossVMCallResponse = {
|
|
|
9276
10360
|
},
|
|
9277
10361
|
fromJSON(object) {
|
|
9278
10362
|
return {
|
|
9279
|
-
messageId: isSet11(object.messageId) ? globalThis.String(object.messageId) : isSet11(object.message_id) ? globalThis.String(object.message_id) : ""
|
|
10363
|
+
messageId: isSet11(object.messageId) ? globalThis.String(object.messageId) : isSet11(object.message_id) ? globalThis.String(object.message_id) : "",
|
|
10364
|
+
executed: isSet11(object.executed) ? globalThis.Boolean(object.executed) : false,
|
|
10365
|
+
data: isSet11(object.data) ? bytesFromBase647(object.data) : new Uint8Array(0),
|
|
10366
|
+
gasUsed: isSet11(object.gasUsed) ? globalThis.String(object.gasUsed) : isSet11(object.gas_used) ? globalThis.String(object.gas_used) : "0"
|
|
9280
10367
|
};
|
|
9281
10368
|
},
|
|
9282
10369
|
toJSON(message) {
|
|
@@ -9284,6 +10371,15 @@ var MsgCrossVMCallResponse = {
|
|
|
9284
10371
|
if (message.messageId !== "") {
|
|
9285
10372
|
obj.messageId = message.messageId;
|
|
9286
10373
|
}
|
|
10374
|
+
if (message.executed !== false) {
|
|
10375
|
+
obj.executed = message.executed;
|
|
10376
|
+
}
|
|
10377
|
+
if (message.data.length !== 0) {
|
|
10378
|
+
obj.data = base64FromBytes7(message.data);
|
|
10379
|
+
}
|
|
10380
|
+
if (message.gasUsed !== "0") {
|
|
10381
|
+
obj.gasUsed = message.gasUsed;
|
|
10382
|
+
}
|
|
9287
10383
|
return obj;
|
|
9288
10384
|
},
|
|
9289
10385
|
create(base) {
|
|
@@ -9292,6 +10388,9 @@ var MsgCrossVMCallResponse = {
|
|
|
9292
10388
|
fromPartial(object) {
|
|
9293
10389
|
const message = createBaseMsgCrossVMCallResponse();
|
|
9294
10390
|
message.messageId = object.messageId ?? "";
|
|
10391
|
+
message.executed = object.executed ?? false;
|
|
10392
|
+
message.data = object.data ?? new Uint8Array(0);
|
|
10393
|
+
message.gasUsed = object.gasUsed ?? "0";
|
|
9295
10394
|
return message;
|
|
9296
10395
|
}
|
|
9297
10396
|
};
|
|
@@ -9385,7 +10484,11 @@ var MsgDefinition10 = {
|
|
|
9385
10484
|
name: "Msg",
|
|
9386
10485
|
fullName: "qorechain.crossvm.v1.Msg",
|
|
9387
10486
|
methods: {
|
|
9388
|
-
/**
|
|
10487
|
+
/**
|
|
10488
|
+
* CrossVMCall invokes a contract on another VM. It executes within the
|
|
10489
|
+
* transaction and returns the callee's answer, unless async is set, in which
|
|
10490
|
+
* case it is queued for ProcessQueue to dispatch later.
|
|
10491
|
+
*/
|
|
9389
10492
|
crossVMCall: {
|
|
9390
10493
|
name: "CrossVMCall",
|
|
9391
10494
|
requestType: MsgCrossVMCall,
|
|
@@ -10001,6 +11104,7 @@ var qorechainRegistryTypes = [
|
|
|
10001
11104
|
["/qorechain.pqc.v1.MsgRegisterPQCKey", MsgRegisterPQCKey],
|
|
10002
11105
|
["/qorechain.pqc.v1.MsgRegisterPQCKeyV2", MsgRegisterPQCKeyV2],
|
|
10003
11106
|
["/qorechain.pqc.v1.MsgMigratePQCKey", MsgMigratePQCKey],
|
|
11107
|
+
["/qorechain.pqc.v1.MsgRotatePQCKey", MsgRotatePQCKey],
|
|
10004
11108
|
["/qorechain.pqc.v1.MsgDeprecateAlgorithm", MsgDeprecateAlgorithm],
|
|
10005
11109
|
["/qorechain.pqc.v1.MsgDisableAlgorithm", MsgDisableAlgorithm],
|
|
10006
11110
|
// svm
|
|
@@ -10008,6 +11112,7 @@ var qorechainRegistryTypes = [
|
|
|
10008
11112
|
["/qorechain.svm.v1.MsgCreateAccount", MsgCreateAccount],
|
|
10009
11113
|
["/qorechain.svm.v1.MsgExecuteProgram", MsgExecuteProgram],
|
|
10010
11114
|
["/qorechain.svm.v1.MsgRegisterSVMPQCKey", MsgRegisterSVMPQCKey],
|
|
11115
|
+
["/qorechain.svm.v1.MsgUpdateParams", MsgUpdateParams],
|
|
10011
11116
|
// lightnode
|
|
10012
11117
|
["/qorechain.lightnode.v1.MsgRegisterLightNode", MsgRegisterLightNode],
|
|
10013
11118
|
["/qorechain.lightnode.v1.MsgHeartbeat", MsgHeartbeat],
|
|
@@ -10041,6 +11146,11 @@ var qorechainRegistryTypes = [
|
|
|
10041
11146
|
"/qorechain.abstractaccount.v1.MsgRevokeAuthenticator",
|
|
10042
11147
|
MsgRevokeAuthenticator
|
|
10043
11148
|
],
|
|
11149
|
+
["/qorechain.abstractaccount.v1.MsgExecuteEVM", MsgExecuteEVM],
|
|
11150
|
+
[
|
|
11151
|
+
"/qorechain.abstractaccount.v1.MsgExecuteCosmos",
|
|
11152
|
+
MsgExecuteCosmos
|
|
11153
|
+
],
|
|
10044
11154
|
// crossvm
|
|
10045
11155
|
["/qorechain.crossvm.v1.MsgCrossVMCall", MsgCrossVMCall],
|
|
10046
11156
|
["/qorechain.crossvm.v1.MsgProcessQueue", MsgProcessQueue],
|
|
@@ -10089,6 +11199,34 @@ var SDK_CODES = {
|
|
|
10089
11199
|
25: { kind: "invalid_gas_limit", message: "invalid gas limit" },
|
|
10090
11200
|
30: { kind: "tx_timeout_height", message: "transaction timeout height exceeded" }
|
|
10091
11201
|
};
|
|
11202
|
+
var ABSTRACTACCOUNT_CODES = {
|
|
11203
|
+
5: {
|
|
11204
|
+
kind: "spending_limit_exceeded",
|
|
11205
|
+
message: "spending limit exceeded \u2014 the amount is over the authenticator's per-tx or daily SpendingRule"
|
|
11206
|
+
},
|
|
11207
|
+
6: {
|
|
11208
|
+
kind: "session_key_expired",
|
|
11209
|
+
message: "session key expired \u2014 the authenticator's expiry_unix has passed; re-register the key"
|
|
11210
|
+
},
|
|
11211
|
+
10: {
|
|
11212
|
+
kind: "permission_denied",
|
|
11213
|
+
message: "permission denied \u2014 the authenticator lacks the permission this message requires (check the permission_schema)"
|
|
11214
|
+
},
|
|
11215
|
+
11: {
|
|
11216
|
+
kind: "authenticator_replay",
|
|
11217
|
+
message: "authenticator replay \u2014 the nonce does not match the account's expected value; refetch the current nonce/sequence and re-sign"
|
|
11218
|
+
}
|
|
11219
|
+
};
|
|
11220
|
+
var PQC_CODES = {
|
|
11221
|
+
21: {
|
|
11222
|
+
kind: "hybrid_verify_failed",
|
|
11223
|
+
message: "hybrid signature verification failed \u2014 the ML-DSA-87 signature did not verify (ensure deterministic signing; hedged signatures are rejected)"
|
|
11224
|
+
}
|
|
11225
|
+
};
|
|
11226
|
+
var MODULE_CODES = {
|
|
11227
|
+
abstractaccount: ABSTRACTACCOUNT_CODES,
|
|
11228
|
+
pqc: PQC_CODES
|
|
11229
|
+
};
|
|
10092
11230
|
var DEFAULT_CODESPACE = "sdk";
|
|
10093
11231
|
function decodeTxError(input) {
|
|
10094
11232
|
const codespace = input.codespace || DEFAULT_CODESPACE;
|
|
@@ -10104,6 +11242,17 @@ function decodeTxError(input) {
|
|
|
10104
11242
|
rawLog
|
|
10105
11243
|
};
|
|
10106
11244
|
}
|
|
11245
|
+
} else {
|
|
11246
|
+
const known = MODULE_CODES[codespace]?.[input.code];
|
|
11247
|
+
if (known) {
|
|
11248
|
+
return {
|
|
11249
|
+
code: input.code,
|
|
11250
|
+
codespace,
|
|
11251
|
+
kind: known.kind,
|
|
11252
|
+
message: rawLog ? `${known.message} (${rawLog})` : known.message,
|
|
11253
|
+
rawLog
|
|
11254
|
+
};
|
|
11255
|
+
}
|
|
10107
11256
|
}
|
|
10108
11257
|
const detail = rawLog && rawLog.length > 0 ? rawLog : "(no log provided)";
|
|
10109
11258
|
return {
|
|
@@ -10311,7 +11460,12 @@ var TxClient = class _TxClient {
|
|
|
10311
11460
|
height: res.height,
|
|
10312
11461
|
gasUsed: res.gasUsed,
|
|
10313
11462
|
gasWanted: res.gasWanted,
|
|
10314
|
-
rawLog: res.rawLog
|
|
11463
|
+
rawLog: res.rawLog,
|
|
11464
|
+
// Carried through so callers can read typed attributes / decode the
|
|
11465
|
+
// per-message responses (e.g. MsgCrossVMCallResponse) without a
|
|
11466
|
+
// second round-trip.
|
|
11467
|
+
events: res.events,
|
|
11468
|
+
msgResponses: res.msgResponses
|
|
10315
11469
|
};
|
|
10316
11470
|
}
|
|
10317
11471
|
const hash = await this.client.signAndBroadcastSync(
|
|
@@ -10939,9 +12093,16 @@ function generatePqcKeypair(seed) {
|
|
|
10939
12093
|
return { publicKey: kp.publicKey, secretKey: kp.secretKey };
|
|
10940
12094
|
}
|
|
10941
12095
|
function pqcSign(secretKey, message, opts) {
|
|
12096
|
+
if (secretKey.length !== ML_DSA_87_SECRET_KEY_LENGTH) {
|
|
12097
|
+
throw new Error(
|
|
12098
|
+
`ML-DSA-87 secret key must be ${ML_DSA_87_SECRET_KEY_LENGTH} bytes, got ${secretKey.length}`
|
|
12099
|
+
);
|
|
12100
|
+
}
|
|
10942
12101
|
return mldsa87.sign(secretKey, message, opts);
|
|
10943
12102
|
}
|
|
10944
12103
|
function pqcVerify(publicKey, message, signature) {
|
|
12104
|
+
if (publicKey.length !== ML_DSA_87_PUBLIC_KEY_LENGTH) return false;
|
|
12105
|
+
if (signature.length !== ML_DSA_87_SIGNATURE_LENGTH) return false;
|
|
10945
12106
|
return mldsa87.verify(publicKey, message, signature);
|
|
10946
12107
|
}
|
|
10947
12108
|
function buildHybridSignatureExtension(args) {
|
|
@@ -11152,37 +12313,17 @@ function unifiedAccountFromSeed(seed32) {
|
|
|
11152
12313
|
pqc: pqc2
|
|
11153
12314
|
};
|
|
11154
12315
|
}
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
if (!pk) throw new Error("Phantom provider exposed no public key");
|
|
11162
|
-
if (pk instanceof Uint8Array) return pk;
|
|
11163
|
-
return pk.toBytes();
|
|
11164
|
-
}
|
|
11165
|
-
function signatureBytes(res) {
|
|
11166
|
-
return res instanceof Uint8Array ? res : res.signature;
|
|
12316
|
+
|
|
12317
|
+
// src/accounts/phantom.ts
|
|
12318
|
+
function unifiedAccountFromPhantomSignature(signatureBytes) {
|
|
12319
|
+
throw new Error(
|
|
12320
|
+
"unifiedAccountFromPhantomSignature was removed in v0.8.0: deriving a spend key from a wallet signature is unsafe \u2014 the signature is a bearer secret that any page can request from the wallet, so whoever obtains it controls the account. Use the authenticator lanes instead: register the external key with MsgRegisterAuthenticator and spend via MsgExecuteCosmos / MsgExecuteEVM (see the Authenticators guide). Any account previously derived this way must be treated as exposed \u2014 move its funds."
|
|
12321
|
+
);
|
|
11167
12322
|
}
|
|
11168
12323
|
async function connectPhantomUnified(opts = {}) {
|
|
11169
|
-
|
|
11170
|
-
|
|
11171
|
-
throw new Error(
|
|
11172
|
-
"no Phantom provider found (window.solana); pass opts.provider"
|
|
11173
|
-
);
|
|
11174
|
-
}
|
|
11175
|
-
const conn = await provider.connect();
|
|
11176
|
-
const pk = pubkeyBytes(
|
|
11177
|
-
provider.publicKey ?? conn.publicKey
|
|
11178
|
-
);
|
|
11179
|
-
const message = `${PHANTOM_DERIVATION_DOMAIN}
|
|
11180
|
-
${base58.encode(pk)}`;
|
|
11181
|
-
const signed = await provider.signMessage(
|
|
11182
|
-
new TextEncoder().encode(message),
|
|
11183
|
-
"utf8"
|
|
12324
|
+
throw new Error(
|
|
12325
|
+
"connectPhantomUnified was removed in v0.8.0: deriving a spend key from a wallet signature is unsafe \u2014 the signature is a bearer secret that any page can request from the wallet, so whoever obtains it controls the account. Use the authenticator lanes instead: register the external key with MsgRegisterAuthenticator and spend via MsgExecuteCosmos / MsgExecuteEVM (see the Authenticators guide). Any account previously derived this way must be treated as exposed \u2014 move its funds."
|
|
11184
12326
|
);
|
|
11185
|
-
return unifiedAccountFromPhantomSignature(signatureBytes(signed));
|
|
11186
12327
|
}
|
|
11187
12328
|
async function directSignerFromPrivateKey(privateKey, prefix) {
|
|
11188
12329
|
if (privateKey.length !== 32) {
|
|
@@ -11339,6 +12480,82 @@ async function withRetry2(fn, opts = {}) {
|
|
|
11339
12480
|
throw lastError;
|
|
11340
12481
|
}
|
|
11341
12482
|
|
|
12483
|
+
// src/tx/authenticator.ts
|
|
12484
|
+
var enc = new TextEncoder();
|
|
12485
|
+
var EVM_AUTH_DOMAIN = "qorechain-evm-auth-v1";
|
|
12486
|
+
var COSMOS_AUTH_DOMAIN = "qorechain-cosmos-auth-v1";
|
|
12487
|
+
var ROTATE_DOMAIN = "qorechain-pqc-rotate-v1";
|
|
12488
|
+
function be64(n) {
|
|
12489
|
+
const b = new Uint8Array(8);
|
|
12490
|
+
let v = BigInt(n);
|
|
12491
|
+
if (v < 0n) throw new Error(`be64: value must be non-negative, got ${n}`);
|
|
12492
|
+
for (let i = 7; i >= 0; i--) {
|
|
12493
|
+
b[i] = Number(v & 0xffn);
|
|
12494
|
+
v >>= 8n;
|
|
12495
|
+
}
|
|
12496
|
+
return b;
|
|
12497
|
+
}
|
|
12498
|
+
function concat(parts) {
|
|
12499
|
+
let len = 0;
|
|
12500
|
+
for (const p of parts) len += p.length;
|
|
12501
|
+
const out = new Uint8Array(len);
|
|
12502
|
+
let o = 0;
|
|
12503
|
+
for (const p of parts) {
|
|
12504
|
+
out.set(p, o);
|
|
12505
|
+
o += p.length;
|
|
12506
|
+
}
|
|
12507
|
+
return out;
|
|
12508
|
+
}
|
|
12509
|
+
function lengthPrefixed(bytes) {
|
|
12510
|
+
return concat([be64(bytes.length), bytes]);
|
|
12511
|
+
}
|
|
12512
|
+
function toBytes2(x) {
|
|
12513
|
+
return typeof x === "string" ? enc.encode(x) : x;
|
|
12514
|
+
}
|
|
12515
|
+
function toHexLower(bytes) {
|
|
12516
|
+
let s = "";
|
|
12517
|
+
for (const b of bytes) s += b.toString(16).padStart(2, "0");
|
|
12518
|
+
return s;
|
|
12519
|
+
}
|
|
12520
|
+
function evmAuthSignBytes(input) {
|
|
12521
|
+
const {
|
|
12522
|
+
chainId,
|
|
12523
|
+
account,
|
|
12524
|
+
pubkey,
|
|
12525
|
+
to = "",
|
|
12526
|
+
value = "0",
|
|
12527
|
+
data = new Uint8Array(0),
|
|
12528
|
+
nonce
|
|
12529
|
+
} = input;
|
|
12530
|
+
const body = concat([
|
|
12531
|
+
enc.encode(EVM_AUTH_DOMAIN),
|
|
12532
|
+
lengthPrefixed(toBytes2(chainId)),
|
|
12533
|
+
lengthPrefixed(toBytes2(account)),
|
|
12534
|
+
lengthPrefixed(pubkey),
|
|
12535
|
+
lengthPrefixed(toBytes2(to)),
|
|
12536
|
+
lengthPrefixed(toBytes2(value)),
|
|
12537
|
+
lengthPrefixed(data),
|
|
12538
|
+
be64(nonce)
|
|
12539
|
+
]);
|
|
12540
|
+
return sha256(body);
|
|
12541
|
+
}
|
|
12542
|
+
function cosmosAuthSignBytes(input) {
|
|
12543
|
+
const { chainId, account, pubkey, to, amount, nonce } = input;
|
|
12544
|
+
const body = concat([
|
|
12545
|
+
enc.encode(COSMOS_AUTH_DOMAIN),
|
|
12546
|
+
lengthPrefixed(toBytes2(chainId)),
|
|
12547
|
+
lengthPrefixed(toBytes2(account)),
|
|
12548
|
+
lengthPrefixed(pubkey),
|
|
12549
|
+
lengthPrefixed(toBytes2(to)),
|
|
12550
|
+
lengthPrefixed(toBytes2(amount)),
|
|
12551
|
+
be64(nonce)
|
|
12552
|
+
]);
|
|
12553
|
+
return sha256(body);
|
|
12554
|
+
}
|
|
12555
|
+
function rotationSignBytes(chainId, algorithmId, account, oldPub, newPub) {
|
|
12556
|
+
return `${ROTATE_DOMAIN}|${chainId}|${algorithmId}|${account}|${toHexLower(oldPub)}|${toHexLower(newPub)}`;
|
|
12557
|
+
}
|
|
12558
|
+
|
|
11342
12559
|
// src/codegen/qorechain/pqc/v1/hybrid.ts
|
|
11343
12560
|
var hybrid_exports = {};
|
|
11344
12561
|
__export(hybrid_exports, {
|
|
@@ -11484,21 +12701,28 @@ function attachHybridExtension(body, ext, opts = {}) {
|
|
|
11484
12701
|
}
|
|
11485
12702
|
return next;
|
|
11486
12703
|
}
|
|
12704
|
+
|
|
12705
|
+
// src/tx/signbytes.ts
|
|
12706
|
+
var SIGN_BYTES_V2_UPGRADE = "v3.1.98";
|
|
12707
|
+
var LEGACY_SIGN_BYTES_CHAINS = [
|
|
12708
|
+
"qorechain-vladi",
|
|
12709
|
+
"qorechain-diana"
|
|
12710
|
+
];
|
|
12711
|
+
var HYBRID_SIGN_BYTES_V2_DOMAIN = "qorechain-pqc-hybrid-v2";
|
|
12712
|
+
var MIGRATION_SIGN_BYTES_V2_DOMAIN = "qorechain-key-migration-v2";
|
|
12713
|
+
var BRIDGE_ATTESTATION_V2_DOMAIN = "qorechain-bridge-attestation-v2";
|
|
12714
|
+
var utf8 = new TextEncoder();
|
|
11487
12715
|
function be32(n) {
|
|
11488
12716
|
const b = new Uint8Array(4);
|
|
11489
|
-
b
|
|
11490
|
-
b[1] = n >>> 16 & 255;
|
|
11491
|
-
b[2] = n >>> 8 & 255;
|
|
11492
|
-
b[3] = n & 255;
|
|
12717
|
+
new DataView(b.buffer).setUint32(0, n >>> 0, false);
|
|
11493
12718
|
return b;
|
|
11494
12719
|
}
|
|
11495
|
-
function
|
|
11496
|
-
const
|
|
11497
|
-
|
|
11498
|
-
|
|
11499
|
-
return out;
|
|
12720
|
+
function be642(n) {
|
|
12721
|
+
const b = new Uint8Array(8);
|
|
12722
|
+
new DataView(b.buffer).setBigUint64(0, BigInt(n), false);
|
|
12723
|
+
return b;
|
|
11500
12724
|
}
|
|
11501
|
-
function
|
|
12725
|
+
function concat2(parts) {
|
|
11502
12726
|
let total = 0;
|
|
11503
12727
|
for (const p of parts) total += p.length;
|
|
11504
12728
|
const out = new Uint8Array(total);
|
|
@@ -11509,6 +12733,154 @@ function concatBytes(...parts) {
|
|
|
11509
12733
|
}
|
|
11510
12734
|
return out;
|
|
11511
12735
|
}
|
|
12736
|
+
function assertVersion(version) {
|
|
12737
|
+
if (version !== "v1" && version !== "v2") {
|
|
12738
|
+
throw new Error(`sign-bytes version must be "v1" or "v2", got ${JSON.stringify(version)}`);
|
|
12739
|
+
}
|
|
12740
|
+
}
|
|
12741
|
+
function hybridSignBytesV1(b0, authInfo) {
|
|
12742
|
+
return concat2([be32(b0.length), b0, be32(authInfo.length), authInfo]);
|
|
12743
|
+
}
|
|
12744
|
+
function hybridSignBytesV2(chainId, b0, authInfo) {
|
|
12745
|
+
const cid = utf8.encode(chainId);
|
|
12746
|
+
return concat2([
|
|
12747
|
+
utf8.encode(HYBRID_SIGN_BYTES_V2_DOMAIN),
|
|
12748
|
+
be642(cid.length),
|
|
12749
|
+
cid,
|
|
12750
|
+
be32(b0.length),
|
|
12751
|
+
b0,
|
|
12752
|
+
be32(authInfo.length),
|
|
12753
|
+
authInfo
|
|
12754
|
+
]);
|
|
12755
|
+
}
|
|
12756
|
+
function hybridSignBytes(version, chainId, b0, authInfo) {
|
|
12757
|
+
assertVersion(version);
|
|
12758
|
+
return version === "v2" ? hybridSignBytesV2(chainId, b0, authInfo) : hybridSignBytesV1(b0, authInfo);
|
|
12759
|
+
}
|
|
12760
|
+
function migrationSignBytesV1(input) {
|
|
12761
|
+
return utf8.encode(
|
|
12762
|
+
`qorechain-key-migration:chain=${input.chainId}:from=${input.fromAlgorithmId}:to=${input.toAlgorithmId}:account=${input.account}:height=${BigInt(input.height)}`
|
|
12763
|
+
);
|
|
12764
|
+
}
|
|
12765
|
+
function migrationSignBytesV2(input) {
|
|
12766
|
+
const cid = utf8.encode(input.chainId);
|
|
12767
|
+
const acct = utf8.encode(input.account);
|
|
12768
|
+
return concat2([
|
|
12769
|
+
utf8.encode(MIGRATION_SIGN_BYTES_V2_DOMAIN),
|
|
12770
|
+
be642(cid.length),
|
|
12771
|
+
cid,
|
|
12772
|
+
be642(acct.length),
|
|
12773
|
+
acct,
|
|
12774
|
+
be32(input.fromAlgorithmId),
|
|
12775
|
+
be32(input.toAlgorithmId),
|
|
12776
|
+
be642(input.height),
|
|
12777
|
+
be32(input.oldPublicKey.length),
|
|
12778
|
+
input.oldPublicKey,
|
|
12779
|
+
be32(input.newPublicKey.length),
|
|
12780
|
+
input.newPublicKey
|
|
12781
|
+
]);
|
|
12782
|
+
}
|
|
12783
|
+
function migrationSignBytes(version, input) {
|
|
12784
|
+
assertVersion(version);
|
|
12785
|
+
return version === "v2" ? migrationSignBytesV2(input) : migrationSignBytesV1(input);
|
|
12786
|
+
}
|
|
12787
|
+
function bridgeAttestationSignBytesV1(input) {
|
|
12788
|
+
return utf8.encode(
|
|
12789
|
+
[input.chain, input.eventType, input.operationId, input.txHash, input.amount, input.asset].join("|")
|
|
12790
|
+
);
|
|
12791
|
+
}
|
|
12792
|
+
function bridgeAttestationSignBytesV2(input) {
|
|
12793
|
+
const parts = [utf8.encode(BRIDGE_ATTESTATION_V2_DOMAIN)];
|
|
12794
|
+
for (const f of [
|
|
12795
|
+
input.chainId,
|
|
12796
|
+
input.chain,
|
|
12797
|
+
input.eventType,
|
|
12798
|
+
input.operationId,
|
|
12799
|
+
input.txHash,
|
|
12800
|
+
input.amount,
|
|
12801
|
+
input.asset
|
|
12802
|
+
]) {
|
|
12803
|
+
const b = utf8.encode(f);
|
|
12804
|
+
parts.push(be642(b.length), b);
|
|
12805
|
+
}
|
|
12806
|
+
return concat2(parts);
|
|
12807
|
+
}
|
|
12808
|
+
function bridgeAttestationSignBytes(version, input) {
|
|
12809
|
+
assertVersion(version);
|
|
12810
|
+
return version === "v2" ? bridgeAttestationSignBytesV2(input) : bridgeAttestationSignBytesV1(input);
|
|
12811
|
+
}
|
|
12812
|
+
function isLegacySignBytesChain(chainId) {
|
|
12813
|
+
return LEGACY_SIGN_BYTES_CHAINS.includes(chainId);
|
|
12814
|
+
}
|
|
12815
|
+
function signBytesVersionFor(chainId, v2AppliedHeight) {
|
|
12816
|
+
return BigInt(v2AppliedHeight) > 0n || !isLegacySignBytesChain(chainId) ? "v2" : "v1";
|
|
12817
|
+
}
|
|
12818
|
+
function parseAppliedHeight(body) {
|
|
12819
|
+
const h = body?.height;
|
|
12820
|
+
if (h === void 0 || h === null || h === "") return 0n;
|
|
12821
|
+
if (typeof h !== "string" && typeof h !== "number" && typeof h !== "bigint") {
|
|
12822
|
+
throw new Error(`unexpected applied_plan height ${JSON.stringify(h)}`);
|
|
12823
|
+
}
|
|
12824
|
+
return BigInt(h);
|
|
12825
|
+
}
|
|
12826
|
+
async function fetchSignBytesV2AppliedHeight(rest, fetchImpl = globalThis.fetch) {
|
|
12827
|
+
const url = `${rest.replace(/\/+$/, "")}/cosmos/upgrade/v1beta1/applied_plan/${SIGN_BYTES_V2_UPGRADE}`;
|
|
12828
|
+
const res = await fetchImpl(url);
|
|
12829
|
+
if (!res.ok) {
|
|
12830
|
+
throw new Error(`applied_plan query failed: HTTP ${res.status} from ${url}`);
|
|
12831
|
+
}
|
|
12832
|
+
return parseAppliedHeight(await res.json());
|
|
12833
|
+
}
|
|
12834
|
+
var cache = /* @__PURE__ */ new Map();
|
|
12835
|
+
function clearSignBytesCache() {
|
|
12836
|
+
cache.clear();
|
|
12837
|
+
}
|
|
12838
|
+
async function resolveSignBytesVersion(opts) {
|
|
12839
|
+
const requested = opts.signBytesVersion ?? "auto";
|
|
12840
|
+
if (requested === "v1" || requested === "v2") return requested;
|
|
12841
|
+
if (requested !== "auto") {
|
|
12842
|
+
throw new Error(`signBytesVersion must be "auto", "v1" or "v2", got ${JSON.stringify(requested)}`);
|
|
12843
|
+
}
|
|
12844
|
+
if (!isLegacySignBytesChain(opts.chainId)) return "v2";
|
|
12845
|
+
if (!opts.rest) {
|
|
12846
|
+
throw new Error(
|
|
12847
|
+
`cannot choose the hybrid sign-bytes form for ${opts.chainId} without its REST endpoint: pass rest, or signBytesVersion "v1" (before the ${SIGN_BYTES_V2_UPGRADE} upgrade) or "v2" (after)`
|
|
12848
|
+
);
|
|
12849
|
+
}
|
|
12850
|
+
const key = `${opts.rest}\0${opts.chainId}`;
|
|
12851
|
+
const ttl = opts.ttlMs ?? 6e4;
|
|
12852
|
+
const hit = cache.get(key);
|
|
12853
|
+
if (!opts.forceRefresh && hit && Date.now() - hit.at < ttl) return hit.version;
|
|
12854
|
+
let height;
|
|
12855
|
+
try {
|
|
12856
|
+
height = await fetchSignBytesV2AppliedHeight(opts.rest, opts.fetch);
|
|
12857
|
+
} catch (e) {
|
|
12858
|
+
throw new Error(
|
|
12859
|
+
`cannot ask ${opts.rest} whether ${SIGN_BYTES_V2_UPGRADE} is applied (${e.message}); pass signBytesVersion "v1" or "v2"`
|
|
12860
|
+
);
|
|
12861
|
+
}
|
|
12862
|
+
const version = signBytesVersionFor(opts.chainId, height);
|
|
12863
|
+
cache.set(key, { version, at: Date.now() });
|
|
12864
|
+
return version;
|
|
12865
|
+
}
|
|
12866
|
+
var HYBRID_SIGN_BYTES_REJECTION_LOG = "hybrid PQC signature verification failed";
|
|
12867
|
+
function isHybridSignBytesRejection(x) {
|
|
12868
|
+
if (x === null || x === void 0) return false;
|
|
12869
|
+
const o = x;
|
|
12870
|
+
if (o.codespace === "pqc" && Number(o.code) === 21) return true;
|
|
12871
|
+
for (const t of [o.log, o.rawLog, o.message]) {
|
|
12872
|
+
if (typeof t === "string" && t.includes(HYBRID_SIGN_BYTES_REJECTION_LOG)) return true;
|
|
12873
|
+
}
|
|
12874
|
+
return false;
|
|
12875
|
+
}
|
|
12876
|
+
|
|
12877
|
+
// src/tx/hybrid-tx.ts
|
|
12878
|
+
function fromBase64(b64) {
|
|
12879
|
+
const binary = atob(b64);
|
|
12880
|
+
const out = new Uint8Array(binary.length);
|
|
12881
|
+
for (let i = 0; i < binary.length; i++) out[i] = binary.charCodeAt(i);
|
|
12882
|
+
return out;
|
|
12883
|
+
}
|
|
11512
12884
|
async function buildHybridTx(opts) {
|
|
11513
12885
|
const {
|
|
11514
12886
|
registry,
|
|
@@ -11544,12 +12916,14 @@ async function buildHybridTx(opts) {
|
|
|
11544
12916
|
fee.payer,
|
|
11545
12917
|
SignMode.SIGN_MODE_DIRECT
|
|
11546
12918
|
);
|
|
11547
|
-
const
|
|
11548
|
-
|
|
11549
|
-
|
|
11550
|
-
|
|
11551
|
-
|
|
11552
|
-
|
|
12919
|
+
const signBytesVersion = await resolveSignBytesVersion({
|
|
12920
|
+
chainId,
|
|
12921
|
+
rest: opts.rest,
|
|
12922
|
+
signBytesVersion: opts.signBytesVersion,
|
|
12923
|
+
fetch: opts.fetch,
|
|
12924
|
+
forceRefresh: opts.forceRefreshSignBytesVersion
|
|
12925
|
+
});
|
|
12926
|
+
const pqcSignedMessage = hybridSignBytes(signBytesVersion, chainId, b0, authInfoBytes);
|
|
11553
12927
|
const pqcSignature = pqcSign(pqcKeypair.secretKey, pqcSignedMessage);
|
|
11554
12928
|
const ext = buildHybridSignatureExtension({
|
|
11555
12929
|
algorithmId: AlgorithmDilithium5,
|
|
@@ -11583,18 +12957,34 @@ async function buildHybridTx(opts) {
|
|
|
11583
12957
|
txRawBytes,
|
|
11584
12958
|
authInfoBytes,
|
|
11585
12959
|
pqcSignedMessage,
|
|
11586
|
-
pqcSignature
|
|
12960
|
+
pqcSignature,
|
|
12961
|
+
signBytesVersion
|
|
11587
12962
|
};
|
|
11588
12963
|
}
|
|
11589
12964
|
async function signAndBroadcastHybrid(opts) {
|
|
12965
|
+
const auto = (opts.signBytesVersion ?? "auto") === "auto";
|
|
12966
|
+
try {
|
|
12967
|
+
return await broadcastHybridOnce(opts, false);
|
|
12968
|
+
} catch (e) {
|
|
12969
|
+
if (!auto || !isHybridSignBytesRejection(e)) throw e;
|
|
12970
|
+
return broadcastHybridOnce(opts, true);
|
|
12971
|
+
}
|
|
12972
|
+
}
|
|
12973
|
+
async function broadcastHybridOnce(opts, forceRefresh) {
|
|
11590
12974
|
const { transport } = opts;
|
|
11591
12975
|
const mode = opts.mode ?? "commit";
|
|
11592
|
-
const built = await buildHybridTx(
|
|
12976
|
+
const built = await buildHybridTx({
|
|
12977
|
+
...opts,
|
|
12978
|
+
forceRefreshSignBytesVersion: forceRefresh || opts.forceRefreshSignBytesVersion
|
|
12979
|
+
});
|
|
11593
12980
|
if (mode === "commit") {
|
|
11594
12981
|
const res = await transport.broadcastTx(built.txRawBytes);
|
|
11595
12982
|
if (res.code !== 0) {
|
|
11596
|
-
throw
|
|
11597
|
-
|
|
12983
|
+
throw Object.assign(
|
|
12984
|
+
new Error(
|
|
12985
|
+
`hybrid transaction failed with code ${res.code}: ${res.rawLog ?? "(no log)"} (hash ${res.transactionHash})`
|
|
12986
|
+
),
|
|
12987
|
+
{ code: res.code, rawLog: res.rawLog, transactionHash: res.transactionHash }
|
|
11598
12988
|
);
|
|
11599
12989
|
}
|
|
11600
12990
|
return {
|
|
@@ -11618,29 +13008,16 @@ function fromHex(hex) {
|
|
|
11618
13008
|
}
|
|
11619
13009
|
return bytes;
|
|
11620
13010
|
}
|
|
11621
|
-
function
|
|
11622
|
-
|
|
11623
|
-
|
|
11624
|
-
|
|
11625
|
-
|
|
11626
|
-
b[3] = n & 255;
|
|
11627
|
-
return b;
|
|
11628
|
-
}
|
|
11629
|
-
function concatBytes2(...parts) {
|
|
11630
|
-
let total = 0;
|
|
11631
|
-
for (const p of parts) total += p.length;
|
|
11632
|
-
const out = new Uint8Array(total);
|
|
11633
|
-
let off = 0;
|
|
11634
|
-
for (const p of parts) {
|
|
11635
|
-
out.set(p, off);
|
|
11636
|
-
off += p.length;
|
|
11637
|
-
}
|
|
11638
|
-
return out;
|
|
13011
|
+
function defaultSignBytesVersion(chainId) {
|
|
13012
|
+
if (!isLegacySignBytesChain(chainId)) return "v2";
|
|
13013
|
+
throw new Error(
|
|
13014
|
+
`signHybridEth on ${chainId} needs signBytesVersion: resolve it with resolveSignBytesVersion({ chainId, rest }) \u2014 the network switches from v1 to v2 at its own upgrade height`
|
|
13015
|
+
);
|
|
11639
13016
|
}
|
|
11640
13017
|
function encodeMessages(params) {
|
|
11641
|
-
const
|
|
13018
|
+
const enc3 = params.encodeMessage;
|
|
11642
13019
|
return params.messages.map((m) => {
|
|
11643
|
-
if (
|
|
13020
|
+
if (enc3) return enc3(m);
|
|
11644
13021
|
if (m.value instanceof Uint8Array) {
|
|
11645
13022
|
return Any.fromPartial({ typeUrl: m.typeUrl, value: m.value });
|
|
11646
13023
|
}
|
|
@@ -11721,12 +13098,8 @@ function signHybridEth(params) {
|
|
|
11721
13098
|
const b0 = TxBody.encode(
|
|
11722
13099
|
TxBody.fromPartial({ messages: encodedMessages, memo, timeoutHeight })
|
|
11723
13100
|
).finish();
|
|
11724
|
-
const
|
|
11725
|
-
|
|
11726
|
-
b0,
|
|
11727
|
-
be322(authInfoBytes.length),
|
|
11728
|
-
authInfoBytes
|
|
11729
|
-
);
|
|
13101
|
+
const version = params.signBytesVersion ?? defaultSignBytesVersion(params.chainId);
|
|
13102
|
+
const pqcSignedMessage = hybridSignBytes(version, params.chainId, b0, authInfoBytes);
|
|
11730
13103
|
const pqcSignature = pqcSign(params.account.pqc.secretKey, pqcSignedMessage);
|
|
11731
13104
|
const ext = buildHybridSignatureExtension({
|
|
11732
13105
|
algorithmId: AlgorithmDilithium5,
|
|
@@ -11775,6 +13148,22 @@ var EthNativeSigner = class {
|
|
|
11775
13148
|
};
|
|
11776
13149
|
this.registry = opts.registry ?? qorechainRegistry();
|
|
11777
13150
|
this.signMode = opts.signMode ?? "hybrid";
|
|
13151
|
+
this.signBytesVersion = opts.signBytesVersion ?? "auto";
|
|
13152
|
+
this.rest = opts.rest;
|
|
13153
|
+
this.fetchImpl = opts.fetch;
|
|
13154
|
+
}
|
|
13155
|
+
/**
|
|
13156
|
+
* The hybrid sign-bytes form for `chainId` under this signer's settings.
|
|
13157
|
+
* Pass `forceRefresh` to bypass the cached answer.
|
|
13158
|
+
*/
|
|
13159
|
+
resolveSignBytesVersion(chainId, forceRefresh = false) {
|
|
13160
|
+
return resolveSignBytesVersion({
|
|
13161
|
+
chainId,
|
|
13162
|
+
rest: this.rest,
|
|
13163
|
+
signBytesVersion: this.signBytesVersion,
|
|
13164
|
+
fetch: this.fetchImpl,
|
|
13165
|
+
forceRefresh
|
|
13166
|
+
});
|
|
11778
13167
|
}
|
|
11779
13168
|
/** Build and sign a `TxRaw` for the given messages. Does not broadcast. */
|
|
11780
13169
|
sign(params) {
|
|
@@ -11787,20 +13176,34 @@ var EthNativeSigner = class {
|
|
|
11787
13176
|
sequence: params.sequence,
|
|
11788
13177
|
memo: params.memo,
|
|
11789
13178
|
timeoutHeight: params.timeoutHeight,
|
|
11790
|
-
encodeMessage: this.encode
|
|
13179
|
+
encodeMessage: this.encode,
|
|
13180
|
+
signBytesVersion: params.signBytesVersion ?? (this.signBytesVersion === "auto" ? void 0 : this.signBytesVersion)
|
|
11791
13181
|
};
|
|
11792
13182
|
return this.signMode === "classical" ? signClassicalEth(signParams) : signHybridEth(signParams);
|
|
11793
13183
|
}
|
|
11794
13184
|
/** Sign and broadcast the given messages via `transport`. */
|
|
11795
13185
|
async signAndBroadcast(transport, params) {
|
|
11796
|
-
const
|
|
11797
|
-
|
|
11798
|
-
|
|
11799
|
-
|
|
11800
|
-
|
|
11801
|
-
|
|
13186
|
+
const once = async (forceRefresh) => {
|
|
13187
|
+
const signBytesVersion = this.signMode === "hybrid" ? params.signBytesVersion ?? await this.resolveSignBytesVersion(params.chainId, forceRefresh) : void 0;
|
|
13188
|
+
const { txRawBytes } = this.sign({ ...params, signBytesVersion });
|
|
13189
|
+
const res = await transport.broadcastTx(txRawBytes);
|
|
13190
|
+
if (res.code !== 0) {
|
|
13191
|
+
throw Object.assign(
|
|
13192
|
+
new Error(
|
|
13193
|
+
`eth-native tx failed with code ${res.code}: ${res.rawLog ?? "(no log)"} (hash ${res.transactionHash})`
|
|
13194
|
+
),
|
|
13195
|
+
{ code: res.code, rawLog: res.rawLog, transactionHash: res.transactionHash }
|
|
13196
|
+
);
|
|
13197
|
+
}
|
|
13198
|
+
return res;
|
|
13199
|
+
};
|
|
13200
|
+
const auto = this.signMode === "hybrid" && params.signBytesVersion === void 0 && this.signBytesVersion === "auto";
|
|
13201
|
+
try {
|
|
13202
|
+
return await once(false);
|
|
13203
|
+
} catch (e) {
|
|
13204
|
+
if (!auto || !isHybridSignBytesRejection(e)) throw e;
|
|
13205
|
+
return once(true);
|
|
11802
13206
|
}
|
|
11803
|
-
return res;
|
|
11804
13207
|
}
|
|
11805
13208
|
/** Send `amount` to `toAddress` via a bank `MsgSend`, signed eth-native. */
|
|
11806
13209
|
bankSend(transport, toAddress, amount, params) {
|
|
@@ -12067,6 +13470,17 @@ var pqc = {
|
|
|
12067
13470
|
disableAlgorithm: composer2(
|
|
12068
13471
|
"/qorechain.pqc.v1.MsgDisableAlgorithm",
|
|
12069
13472
|
MsgDisableAlgorithm
|
|
13473
|
+
),
|
|
13474
|
+
/**
|
|
13475
|
+
* Replace an account's PQC key with a NEW key of the SAME algorithm (rotate a
|
|
13476
|
+
* compromised key, or migrate a legacy-derived key to the canonical
|
|
13477
|
+
* derivation). Dual-signed over the domain-separated rotation bytes (the old
|
|
13478
|
+
* key proves ownership, the new key proves control). Sender-signed; broadcast
|
|
13479
|
+
* BY the account, cosigned (hybrid) with the OLD key.
|
|
13480
|
+
*/
|
|
13481
|
+
rotatePqcKey: composer2(
|
|
13482
|
+
"/qorechain.pqc.v1.MsgRotatePQCKey",
|
|
13483
|
+
MsgRotatePQCKey
|
|
12070
13484
|
)
|
|
12071
13485
|
};
|
|
12072
13486
|
var svm = {
|
|
@@ -12085,6 +13499,20 @@ var svm = {
|
|
|
12085
13499
|
registerSvmPqcKey: composer2(
|
|
12086
13500
|
"/qorechain.svm.v1.MsgRegisterSVMPQCKey",
|
|
12087
13501
|
MsgRegisterSVMPQCKey
|
|
13502
|
+
),
|
|
13503
|
+
/**
|
|
13504
|
+
* Replace the x/svm runtime parameters wholesale (chain v3.1.97).
|
|
13505
|
+
*
|
|
13506
|
+
* GOVERNANCE ONLY: `authority` must be the governance module account, so this
|
|
13507
|
+
* message is submitted inside a gov proposal, not signed by a user. It is what
|
|
13508
|
+
* makes enabling/disabling the SVM lane a proposal rather than a binary
|
|
13509
|
+
* release. `params` is replaced in full — send every field, not just the ones
|
|
13510
|
+
* you mean to change. `rentExemptionMulti` is a `LegacyDec` string (e.g.
|
|
13511
|
+
* `"2.000000000000000000"`).
|
|
13512
|
+
*/
|
|
13513
|
+
updateParams: composer2(
|
|
13514
|
+
"/qorechain.svm.v1.MsgUpdateParams",
|
|
13515
|
+
MsgUpdateParams
|
|
12088
13516
|
)
|
|
12089
13517
|
};
|
|
12090
13518
|
var lightnode = {
|
|
@@ -12145,6 +13573,26 @@ var abstractaccount = {
|
|
|
12145
13573
|
revokeAuthenticator: composer2(
|
|
12146
13574
|
"/qorechain.abstractaccount.v1.MsgRevokeAuthenticator",
|
|
12147
13575
|
MsgRevokeAuthenticator
|
|
13576
|
+
),
|
|
13577
|
+
/**
|
|
13578
|
+
* EVM-lane spend: execute an EVM call/transfer FROM the canonical account's
|
|
13579
|
+
* 0x address, authorized by a linked authenticator's signature over the EVM
|
|
13580
|
+
* auth sign-bytes. Relayer-signed (it submits + pays fees). See
|
|
13581
|
+
* {@link ../tx/authenticator.evmAuthSignBytes}.
|
|
13582
|
+
*/
|
|
13583
|
+
executeEvm: composer2(
|
|
13584
|
+
"/qorechain.abstractaccount.v1.MsgExecuteEVM",
|
|
13585
|
+
MsgExecuteEVM
|
|
13586
|
+
),
|
|
13587
|
+
/**
|
|
13588
|
+
* Native-lane spend: move native QOR FROM the canonical account via x/bank,
|
|
13589
|
+
* authorized by a linked authenticator's signature over the Cosmos auth
|
|
13590
|
+
* sign-bytes. Relayer-signed (it submits + pays fees). See
|
|
13591
|
+
* {@link ../tx/authenticator.cosmosAuthSignBytes}.
|
|
13592
|
+
*/
|
|
13593
|
+
executeCosmos: composer2(
|
|
13594
|
+
"/qorechain.abstractaccount.v1.MsgExecuteCosmos",
|
|
13595
|
+
MsgExecuteCosmos
|
|
12148
13596
|
)
|
|
12149
13597
|
};
|
|
12150
13598
|
var crossvm = {
|
|
@@ -12242,6 +13690,9 @@ __export(query_exports, {
|
|
|
12242
13690
|
QueryConfigRequest: () => QueryConfigRequest,
|
|
12243
13691
|
QueryConfigResponse: () => QueryConfigResponse,
|
|
12244
13692
|
QueryDefinition: () => QueryDefinition,
|
|
13693
|
+
QueryPermissionSchemaRequest: () => QueryPermissionSchemaRequest,
|
|
13694
|
+
QueryPermissionSchemaResponse: () => QueryPermissionSchemaResponse,
|
|
13695
|
+
QueryPermissionSchemaResponse_MsgPermissionsEntry: () => QueryPermissionSchemaResponse_MsgPermissionsEntry,
|
|
12245
13696
|
protobufPackage: () => protobufPackage13
|
|
12246
13697
|
});
|
|
12247
13698
|
var protobufPackage13 = "qorechain.abstractaccount.v1";
|
|
@@ -12770,6 +14221,236 @@ var QueryAccountsResponse = {
|
|
|
12770
14221
|
return message;
|
|
12771
14222
|
}
|
|
12772
14223
|
};
|
|
14224
|
+
function createBaseQueryPermissionSchemaRequest() {
|
|
14225
|
+
return {};
|
|
14226
|
+
}
|
|
14227
|
+
var QueryPermissionSchemaRequest = {
|
|
14228
|
+
encode(_, writer = new BinaryWriter()) {
|
|
14229
|
+
return writer;
|
|
14230
|
+
},
|
|
14231
|
+
decode(input, length) {
|
|
14232
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
14233
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
14234
|
+
const message = createBaseQueryPermissionSchemaRequest();
|
|
14235
|
+
while (reader.pos < end) {
|
|
14236
|
+
const tag = reader.uint32();
|
|
14237
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
14238
|
+
break;
|
|
14239
|
+
}
|
|
14240
|
+
reader.skip(tag & 7);
|
|
14241
|
+
}
|
|
14242
|
+
return message;
|
|
14243
|
+
},
|
|
14244
|
+
fromJSON(_) {
|
|
14245
|
+
return {};
|
|
14246
|
+
},
|
|
14247
|
+
toJSON(_) {
|
|
14248
|
+
const obj = {};
|
|
14249
|
+
return obj;
|
|
14250
|
+
},
|
|
14251
|
+
create(base) {
|
|
14252
|
+
return QueryPermissionSchemaRequest.fromPartial(base ?? {});
|
|
14253
|
+
},
|
|
14254
|
+
fromPartial(_) {
|
|
14255
|
+
const message = createBaseQueryPermissionSchemaRequest();
|
|
14256
|
+
return message;
|
|
14257
|
+
}
|
|
14258
|
+
};
|
|
14259
|
+
function createBaseQueryPermissionSchemaResponse() {
|
|
14260
|
+
return { schemaVersion: "", permissions: [], msgPermissions: {}, keyManagementMsgs: [] };
|
|
14261
|
+
}
|
|
14262
|
+
var QueryPermissionSchemaResponse = {
|
|
14263
|
+
encode(message, writer = new BinaryWriter()) {
|
|
14264
|
+
if (message.schemaVersion !== "") {
|
|
14265
|
+
writer.uint32(10).string(message.schemaVersion);
|
|
14266
|
+
}
|
|
14267
|
+
for (const v of message.permissions) {
|
|
14268
|
+
writer.uint32(18).string(v);
|
|
14269
|
+
}
|
|
14270
|
+
globalThis.Object.entries(message.msgPermissions).forEach(([key, value]) => {
|
|
14271
|
+
QueryPermissionSchemaResponse_MsgPermissionsEntry.encode({ key, value }, writer.uint32(26).fork()).join();
|
|
14272
|
+
});
|
|
14273
|
+
for (const v of message.keyManagementMsgs) {
|
|
14274
|
+
writer.uint32(34).string(v);
|
|
14275
|
+
}
|
|
14276
|
+
return writer;
|
|
14277
|
+
},
|
|
14278
|
+
decode(input, length) {
|
|
14279
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
14280
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
14281
|
+
const message = createBaseQueryPermissionSchemaResponse();
|
|
14282
|
+
while (reader.pos < end) {
|
|
14283
|
+
const tag = reader.uint32();
|
|
14284
|
+
switch (tag >>> 3) {
|
|
14285
|
+
case 1: {
|
|
14286
|
+
if (tag !== 10) {
|
|
14287
|
+
break;
|
|
14288
|
+
}
|
|
14289
|
+
message.schemaVersion = reader.string();
|
|
14290
|
+
continue;
|
|
14291
|
+
}
|
|
14292
|
+
case 2: {
|
|
14293
|
+
if (tag !== 18) {
|
|
14294
|
+
break;
|
|
14295
|
+
}
|
|
14296
|
+
message.permissions.push(reader.string());
|
|
14297
|
+
continue;
|
|
14298
|
+
}
|
|
14299
|
+
case 3: {
|
|
14300
|
+
if (tag !== 26) {
|
|
14301
|
+
break;
|
|
14302
|
+
}
|
|
14303
|
+
const entry3 = QueryPermissionSchemaResponse_MsgPermissionsEntry.decode(reader, reader.uint32());
|
|
14304
|
+
if (entry3.value !== void 0) {
|
|
14305
|
+
message.msgPermissions[entry3.key] = entry3.value;
|
|
14306
|
+
}
|
|
14307
|
+
continue;
|
|
14308
|
+
}
|
|
14309
|
+
case 4: {
|
|
14310
|
+
if (tag !== 34) {
|
|
14311
|
+
break;
|
|
14312
|
+
}
|
|
14313
|
+
message.keyManagementMsgs.push(reader.string());
|
|
14314
|
+
continue;
|
|
14315
|
+
}
|
|
14316
|
+
}
|
|
14317
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
14318
|
+
break;
|
|
14319
|
+
}
|
|
14320
|
+
reader.skip(tag & 7);
|
|
14321
|
+
}
|
|
14322
|
+
return message;
|
|
14323
|
+
},
|
|
14324
|
+
fromJSON(object) {
|
|
14325
|
+
return {
|
|
14326
|
+
schemaVersion: isSet14(object.schemaVersion) ? globalThis.String(object.schemaVersion) : isSet14(object.schema_version) ? globalThis.String(object.schema_version) : "",
|
|
14327
|
+
permissions: globalThis.Array.isArray(object?.permissions) ? object.permissions.map((e) => globalThis.String(e)) : [],
|
|
14328
|
+
msgPermissions: isObject(object.msgPermissions) ? globalThis.Object.entries(object.msgPermissions).reduce(
|
|
14329
|
+
(acc, [key, value]) => {
|
|
14330
|
+
acc[key] = globalThis.String(value);
|
|
14331
|
+
return acc;
|
|
14332
|
+
},
|
|
14333
|
+
{}
|
|
14334
|
+
) : isObject(object.msg_permissions) ? globalThis.Object.entries(object.msg_permissions).reduce(
|
|
14335
|
+
(acc, [key, value]) => {
|
|
14336
|
+
acc[key] = globalThis.String(value);
|
|
14337
|
+
return acc;
|
|
14338
|
+
},
|
|
14339
|
+
{}
|
|
14340
|
+
) : {},
|
|
14341
|
+
keyManagementMsgs: globalThis.Array.isArray(object?.keyManagementMsgs) ? object.keyManagementMsgs.map((e) => globalThis.String(e)) : globalThis.Array.isArray(object?.key_management_msgs) ? object.key_management_msgs.map((e) => globalThis.String(e)) : []
|
|
14342
|
+
};
|
|
14343
|
+
},
|
|
14344
|
+
toJSON(message) {
|
|
14345
|
+
const obj = {};
|
|
14346
|
+
if (message.schemaVersion !== "") {
|
|
14347
|
+
obj.schemaVersion = message.schemaVersion;
|
|
14348
|
+
}
|
|
14349
|
+
if (message.permissions?.length) {
|
|
14350
|
+
obj.permissions = message.permissions;
|
|
14351
|
+
}
|
|
14352
|
+
if (message.msgPermissions) {
|
|
14353
|
+
const entries = globalThis.Object.entries(message.msgPermissions);
|
|
14354
|
+
if (entries.length > 0) {
|
|
14355
|
+
obj.msgPermissions = {};
|
|
14356
|
+
entries.forEach(([k, v]) => {
|
|
14357
|
+
obj.msgPermissions[k] = v;
|
|
14358
|
+
});
|
|
14359
|
+
}
|
|
14360
|
+
}
|
|
14361
|
+
if (message.keyManagementMsgs?.length) {
|
|
14362
|
+
obj.keyManagementMsgs = message.keyManagementMsgs;
|
|
14363
|
+
}
|
|
14364
|
+
return obj;
|
|
14365
|
+
},
|
|
14366
|
+
create(base) {
|
|
14367
|
+
return QueryPermissionSchemaResponse.fromPartial(base ?? {});
|
|
14368
|
+
},
|
|
14369
|
+
fromPartial(object) {
|
|
14370
|
+
const message = createBaseQueryPermissionSchemaResponse();
|
|
14371
|
+
message.schemaVersion = object.schemaVersion ?? "";
|
|
14372
|
+
message.permissions = object.permissions?.map((e) => e) || [];
|
|
14373
|
+
message.msgPermissions = globalThis.Object.entries(object.msgPermissions ?? {}).reduce(
|
|
14374
|
+
(acc, [key, value]) => {
|
|
14375
|
+
if (value !== void 0) {
|
|
14376
|
+
acc[key] = globalThis.String(value);
|
|
14377
|
+
}
|
|
14378
|
+
return acc;
|
|
14379
|
+
},
|
|
14380
|
+
{}
|
|
14381
|
+
);
|
|
14382
|
+
message.keyManagementMsgs = object.keyManagementMsgs?.map((e) => e) || [];
|
|
14383
|
+
return message;
|
|
14384
|
+
}
|
|
14385
|
+
};
|
|
14386
|
+
function createBaseQueryPermissionSchemaResponse_MsgPermissionsEntry() {
|
|
14387
|
+
return { key: "", value: "" };
|
|
14388
|
+
}
|
|
14389
|
+
var QueryPermissionSchemaResponse_MsgPermissionsEntry = {
|
|
14390
|
+
encode(message, writer = new BinaryWriter()) {
|
|
14391
|
+
if (message.key !== "") {
|
|
14392
|
+
writer.uint32(10).string(message.key);
|
|
14393
|
+
}
|
|
14394
|
+
if (message.value !== "") {
|
|
14395
|
+
writer.uint32(18).string(message.value);
|
|
14396
|
+
}
|
|
14397
|
+
return writer;
|
|
14398
|
+
},
|
|
14399
|
+
decode(input, length) {
|
|
14400
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
14401
|
+
const end = length === void 0 ? reader.len : reader.pos + length;
|
|
14402
|
+
const message = createBaseQueryPermissionSchemaResponse_MsgPermissionsEntry();
|
|
14403
|
+
while (reader.pos < end) {
|
|
14404
|
+
const tag = reader.uint32();
|
|
14405
|
+
switch (tag >>> 3) {
|
|
14406
|
+
case 1: {
|
|
14407
|
+
if (tag !== 10) {
|
|
14408
|
+
break;
|
|
14409
|
+
}
|
|
14410
|
+
message.key = reader.string();
|
|
14411
|
+
continue;
|
|
14412
|
+
}
|
|
14413
|
+
case 2: {
|
|
14414
|
+
if (tag !== 18) {
|
|
14415
|
+
break;
|
|
14416
|
+
}
|
|
14417
|
+
message.value = reader.string();
|
|
14418
|
+
continue;
|
|
14419
|
+
}
|
|
14420
|
+
}
|
|
14421
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
14422
|
+
break;
|
|
14423
|
+
}
|
|
14424
|
+
reader.skip(tag & 7);
|
|
14425
|
+
}
|
|
14426
|
+
return message;
|
|
14427
|
+
},
|
|
14428
|
+
fromJSON(object) {
|
|
14429
|
+
return {
|
|
14430
|
+
key: isSet14(object.key) ? globalThis.String(object.key) : "",
|
|
14431
|
+
value: isSet14(object.value) ? globalThis.String(object.value) : ""
|
|
14432
|
+
};
|
|
14433
|
+
},
|
|
14434
|
+
toJSON(message) {
|
|
14435
|
+
const obj = {};
|
|
14436
|
+
if (message.key !== "") {
|
|
14437
|
+
obj.key = message.key;
|
|
14438
|
+
}
|
|
14439
|
+
if (message.value !== "") {
|
|
14440
|
+
obj.value = message.value;
|
|
14441
|
+
}
|
|
14442
|
+
return obj;
|
|
14443
|
+
},
|
|
14444
|
+
create(base) {
|
|
14445
|
+
return QueryPermissionSchemaResponse_MsgPermissionsEntry.fromPartial(base ?? {});
|
|
14446
|
+
},
|
|
14447
|
+
fromPartial(object) {
|
|
14448
|
+
const message = createBaseQueryPermissionSchemaResponse_MsgPermissionsEntry();
|
|
14449
|
+
message.key = object.key ?? "";
|
|
14450
|
+
message.value = object.value ?? "";
|
|
14451
|
+
return message;
|
|
14452
|
+
}
|
|
14453
|
+
};
|
|
12773
14454
|
var QueryDefinition = {
|
|
12774
14455
|
name: "Query",
|
|
12775
14456
|
fullName: "qorechain.abstractaccount.v1.Query",
|
|
@@ -12781,7 +14462,53 @@ var QueryDefinition = {
|
|
|
12781
14462
|
requestStream: false,
|
|
12782
14463
|
responseType: QueryConfigResponse,
|
|
12783
14464
|
responseStream: false,
|
|
12784
|
-
options: {
|
|
14465
|
+
options: {
|
|
14466
|
+
_unknownFields: {
|
|
14467
|
+
578365826: [
|
|
14468
|
+
new Uint8Array([
|
|
14469
|
+
38,
|
|
14470
|
+
18,
|
|
14471
|
+
36,
|
|
14472
|
+
47,
|
|
14473
|
+
113,
|
|
14474
|
+
111,
|
|
14475
|
+
114,
|
|
14476
|
+
101,
|
|
14477
|
+
99,
|
|
14478
|
+
104,
|
|
14479
|
+
97,
|
|
14480
|
+
105,
|
|
14481
|
+
110,
|
|
14482
|
+
47,
|
|
14483
|
+
97,
|
|
14484
|
+
98,
|
|
14485
|
+
115,
|
|
14486
|
+
116,
|
|
14487
|
+
114,
|
|
14488
|
+
97,
|
|
14489
|
+
99,
|
|
14490
|
+
116,
|
|
14491
|
+
97,
|
|
14492
|
+
99,
|
|
14493
|
+
99,
|
|
14494
|
+
111,
|
|
14495
|
+
117,
|
|
14496
|
+
110,
|
|
14497
|
+
116,
|
|
14498
|
+
47,
|
|
14499
|
+
118,
|
|
14500
|
+
49,
|
|
14501
|
+
47,
|
|
14502
|
+
99,
|
|
14503
|
+
111,
|
|
14504
|
+
110,
|
|
14505
|
+
102,
|
|
14506
|
+
105,
|
|
14507
|
+
103
|
|
14508
|
+
])
|
|
14509
|
+
]
|
|
14510
|
+
}
|
|
14511
|
+
}
|
|
12785
14512
|
},
|
|
12786
14513
|
/** Account returns a single abstract account by address. */
|
|
12787
14514
|
account: {
|
|
@@ -12790,7 +14517,65 @@ var QueryDefinition = {
|
|
|
12790
14517
|
requestStream: false,
|
|
12791
14518
|
responseType: QueryAccountResponse,
|
|
12792
14519
|
responseStream: false,
|
|
12793
|
-
options: {
|
|
14520
|
+
options: {
|
|
14521
|
+
_unknownFields: {
|
|
14522
|
+
578365826: [
|
|
14523
|
+
new Uint8Array([
|
|
14524
|
+
50,
|
|
14525
|
+
18,
|
|
14526
|
+
48,
|
|
14527
|
+
47,
|
|
14528
|
+
113,
|
|
14529
|
+
111,
|
|
14530
|
+
114,
|
|
14531
|
+
101,
|
|
14532
|
+
99,
|
|
14533
|
+
104,
|
|
14534
|
+
97,
|
|
14535
|
+
105,
|
|
14536
|
+
110,
|
|
14537
|
+
47,
|
|
14538
|
+
97,
|
|
14539
|
+
98,
|
|
14540
|
+
115,
|
|
14541
|
+
116,
|
|
14542
|
+
114,
|
|
14543
|
+
97,
|
|
14544
|
+
99,
|
|
14545
|
+
116,
|
|
14546
|
+
97,
|
|
14547
|
+
99,
|
|
14548
|
+
99,
|
|
14549
|
+
111,
|
|
14550
|
+
117,
|
|
14551
|
+
110,
|
|
14552
|
+
116,
|
|
14553
|
+
47,
|
|
14554
|
+
118,
|
|
14555
|
+
49,
|
|
14556
|
+
47,
|
|
14557
|
+
97,
|
|
14558
|
+
99,
|
|
14559
|
+
99,
|
|
14560
|
+
111,
|
|
14561
|
+
117,
|
|
14562
|
+
110,
|
|
14563
|
+
116,
|
|
14564
|
+
115,
|
|
14565
|
+
47,
|
|
14566
|
+
123,
|
|
14567
|
+
97,
|
|
14568
|
+
100,
|
|
14569
|
+
100,
|
|
14570
|
+
114,
|
|
14571
|
+
101,
|
|
14572
|
+
115,
|
|
14573
|
+
115,
|
|
14574
|
+
125
|
|
14575
|
+
])
|
|
14576
|
+
]
|
|
14577
|
+
}
|
|
14578
|
+
}
|
|
12794
14579
|
},
|
|
12795
14580
|
/** Accounts lists all abstract accounts. */
|
|
12796
14581
|
accounts: {
|
|
@@ -12799,10 +14584,131 @@ var QueryDefinition = {
|
|
|
12799
14584
|
requestStream: false,
|
|
12800
14585
|
responseType: QueryAccountsResponse,
|
|
12801
14586
|
responseStream: false,
|
|
12802
|
-
options: {
|
|
14587
|
+
options: {
|
|
14588
|
+
_unknownFields: {
|
|
14589
|
+
578365826: [
|
|
14590
|
+
new Uint8Array([
|
|
14591
|
+
40,
|
|
14592
|
+
18,
|
|
14593
|
+
38,
|
|
14594
|
+
47,
|
|
14595
|
+
113,
|
|
14596
|
+
111,
|
|
14597
|
+
114,
|
|
14598
|
+
101,
|
|
14599
|
+
99,
|
|
14600
|
+
104,
|
|
14601
|
+
97,
|
|
14602
|
+
105,
|
|
14603
|
+
110,
|
|
14604
|
+
47,
|
|
14605
|
+
97,
|
|
14606
|
+
98,
|
|
14607
|
+
115,
|
|
14608
|
+
116,
|
|
14609
|
+
114,
|
|
14610
|
+
97,
|
|
14611
|
+
99,
|
|
14612
|
+
116,
|
|
14613
|
+
97,
|
|
14614
|
+
99,
|
|
14615
|
+
99,
|
|
14616
|
+
111,
|
|
14617
|
+
117,
|
|
14618
|
+
110,
|
|
14619
|
+
116,
|
|
14620
|
+
47,
|
|
14621
|
+
118,
|
|
14622
|
+
49,
|
|
14623
|
+
47,
|
|
14624
|
+
97,
|
|
14625
|
+
99,
|
|
14626
|
+
99,
|
|
14627
|
+
111,
|
|
14628
|
+
117,
|
|
14629
|
+
110,
|
|
14630
|
+
116,
|
|
14631
|
+
115
|
|
14632
|
+
])
|
|
14633
|
+
]
|
|
14634
|
+
}
|
|
14635
|
+
}
|
|
14636
|
+
},
|
|
14637
|
+
/**
|
|
14638
|
+
* PermissionSchema returns the canonical authenticator permission taxonomy so
|
|
14639
|
+
* clients (QoreX/dashboard/relayer) validate scopes without hardcoding strings
|
|
14640
|
+
* and detect drift via schema_version (v3.1.85).
|
|
14641
|
+
*/
|
|
14642
|
+
permissionSchema: {
|
|
14643
|
+
name: "PermissionSchema",
|
|
14644
|
+
requestType: QueryPermissionSchemaRequest,
|
|
14645
|
+
requestStream: false,
|
|
14646
|
+
responseType: QueryPermissionSchemaResponse,
|
|
14647
|
+
responseStream: false,
|
|
14648
|
+
options: {
|
|
14649
|
+
_unknownFields: {
|
|
14650
|
+
578365826: [
|
|
14651
|
+
new Uint8Array([
|
|
14652
|
+
49,
|
|
14653
|
+
18,
|
|
14654
|
+
47,
|
|
14655
|
+
47,
|
|
14656
|
+
113,
|
|
14657
|
+
111,
|
|
14658
|
+
114,
|
|
14659
|
+
101,
|
|
14660
|
+
99,
|
|
14661
|
+
104,
|
|
14662
|
+
97,
|
|
14663
|
+
105,
|
|
14664
|
+
110,
|
|
14665
|
+
47,
|
|
14666
|
+
97,
|
|
14667
|
+
98,
|
|
14668
|
+
115,
|
|
14669
|
+
116,
|
|
14670
|
+
114,
|
|
14671
|
+
97,
|
|
14672
|
+
99,
|
|
14673
|
+
116,
|
|
14674
|
+
97,
|
|
14675
|
+
99,
|
|
14676
|
+
99,
|
|
14677
|
+
111,
|
|
14678
|
+
117,
|
|
14679
|
+
110,
|
|
14680
|
+
116,
|
|
14681
|
+
47,
|
|
14682
|
+
118,
|
|
14683
|
+
49,
|
|
14684
|
+
47,
|
|
14685
|
+
112,
|
|
14686
|
+
101,
|
|
14687
|
+
114,
|
|
14688
|
+
109,
|
|
14689
|
+
105,
|
|
14690
|
+
115,
|
|
14691
|
+
115,
|
|
14692
|
+
105,
|
|
14693
|
+
111,
|
|
14694
|
+
110,
|
|
14695
|
+
95,
|
|
14696
|
+
115,
|
|
14697
|
+
99,
|
|
14698
|
+
104,
|
|
14699
|
+
101,
|
|
14700
|
+
109,
|
|
14701
|
+
97
|
|
14702
|
+
])
|
|
14703
|
+
]
|
|
14704
|
+
}
|
|
14705
|
+
}
|
|
12803
14706
|
}
|
|
12804
14707
|
}
|
|
12805
14708
|
};
|
|
14709
|
+
function isObject(value) {
|
|
14710
|
+
return typeof value === "object" && value !== null;
|
|
14711
|
+
}
|
|
12806
14712
|
function isSet14(value) {
|
|
12807
14713
|
return value !== null && value !== void 0;
|
|
12808
14714
|
}
|
|
@@ -24017,6 +25923,277 @@ function base64FromBytes11(arr) {
|
|
|
24017
25923
|
function isSet26(value) {
|
|
24018
25924
|
return value !== null && value !== void 0;
|
|
24019
25925
|
}
|
|
25926
|
+
var enc2 = new TextEncoder();
|
|
25927
|
+
function toBytes3(x) {
|
|
25928
|
+
return typeof x === "string" ? enc2.encode(x) : x;
|
|
25929
|
+
}
|
|
25930
|
+
function hexToBytes3(hex) {
|
|
25931
|
+
const h = hex.replace(/^0x/, "");
|
|
25932
|
+
const out = new Uint8Array(h.length / 2);
|
|
25933
|
+
for (let i = 0; i < out.length; i++) {
|
|
25934
|
+
out[i] = parseInt(h.slice(i * 2, i * 2 + 2), 16);
|
|
25935
|
+
}
|
|
25936
|
+
return out;
|
|
25937
|
+
}
|
|
25938
|
+
function bytesToHex0x(b) {
|
|
25939
|
+
let s = "0x";
|
|
25940
|
+
for (const x of b) s += x.toString(16).padStart(2, "0");
|
|
25941
|
+
return s;
|
|
25942
|
+
}
|
|
25943
|
+
function toHexLower2(b) {
|
|
25944
|
+
let s = "";
|
|
25945
|
+
for (const x of b) s += x.toString(16).padStart(2, "0");
|
|
25946
|
+
return s;
|
|
25947
|
+
}
|
|
25948
|
+
function parseCoins(amount) {
|
|
25949
|
+
const m = /^([0-9]+)([a-zA-Z][a-zA-Z0-9/:._-]*)$/.exec(String(amount).trim());
|
|
25950
|
+
if (!m) {
|
|
25951
|
+
throw new Error(`invalid amount "${amount}" (expected e.g. "100uqor")`);
|
|
25952
|
+
}
|
|
25953
|
+
return [{ denom: m[2], amount: m[1] }];
|
|
25954
|
+
}
|
|
25955
|
+
function executeEvmMsg(input) {
|
|
25956
|
+
const {
|
|
25957
|
+
relayer,
|
|
25958
|
+
account,
|
|
25959
|
+
scheme,
|
|
25960
|
+
pubkey,
|
|
25961
|
+
signature,
|
|
25962
|
+
to = "",
|
|
25963
|
+
value = "0",
|
|
25964
|
+
data = new Uint8Array(0),
|
|
25965
|
+
gasLimit,
|
|
25966
|
+
nonce
|
|
25967
|
+
} = input;
|
|
25968
|
+
return {
|
|
25969
|
+
typeUrl: "/qorechain.abstractaccount.v1.MsgExecuteEVM",
|
|
25970
|
+
value: {
|
|
25971
|
+
relayer,
|
|
25972
|
+
account,
|
|
25973
|
+
scheme,
|
|
25974
|
+
pubkey: toBytes3(pubkey),
|
|
25975
|
+
signature: toBytes3(signature),
|
|
25976
|
+
to,
|
|
25977
|
+
value,
|
|
25978
|
+
data: toBytes3(data),
|
|
25979
|
+
gasLimit: BigInt(gasLimit),
|
|
25980
|
+
nonce: BigInt(nonce)
|
|
25981
|
+
}
|
|
25982
|
+
};
|
|
25983
|
+
}
|
|
25984
|
+
function executeCosmosMsg(input) {
|
|
25985
|
+
const { relayer, account, scheme, pubkey, signature, to, amount, nonce } = input;
|
|
25986
|
+
return {
|
|
25987
|
+
typeUrl: "/qorechain.abstractaccount.v1.MsgExecuteCosmos",
|
|
25988
|
+
value: {
|
|
25989
|
+
relayer,
|
|
25990
|
+
account,
|
|
25991
|
+
scheme,
|
|
25992
|
+
pubkey: toBytes3(pubkey),
|
|
25993
|
+
signature: toBytes3(signature),
|
|
25994
|
+
to,
|
|
25995
|
+
amount: parseCoins(amount),
|
|
25996
|
+
nonce: BigInt(nonce)
|
|
25997
|
+
}
|
|
25998
|
+
};
|
|
25999
|
+
}
|
|
26000
|
+
function revokeAuthenticatorMsg(input) {
|
|
26001
|
+
const { owner, account = owner, scheme, pubkey } = input;
|
|
26002
|
+
return {
|
|
26003
|
+
typeUrl: "/qorechain.abstractaccount.v1.MsgRevokeAuthenticator",
|
|
26004
|
+
value: {
|
|
26005
|
+
owner,
|
|
26006
|
+
accountAddress: account,
|
|
26007
|
+
scheme,
|
|
26008
|
+
pubkey: toBytes3(pubkey)
|
|
26009
|
+
}
|
|
26010
|
+
};
|
|
26011
|
+
}
|
|
26012
|
+
function registerEthAuthenticatorMsg(input) {
|
|
26013
|
+
const {
|
|
26014
|
+
owner,
|
|
26015
|
+
account = owner,
|
|
26016
|
+
ethAddress,
|
|
26017
|
+
permissions = ["evm"],
|
|
26018
|
+
expiryUnix,
|
|
26019
|
+
label = "metamask"
|
|
26020
|
+
} = input;
|
|
26021
|
+
return {
|
|
26022
|
+
typeUrl: "/qorechain.abstractaccount.v1.MsgRegisterAuthenticator",
|
|
26023
|
+
value: {
|
|
26024
|
+
owner,
|
|
26025
|
+
accountAddress: account,
|
|
26026
|
+
scheme: "secp256k1",
|
|
26027
|
+
pubkey: hexToBytes3(ethAddress),
|
|
26028
|
+
permissions,
|
|
26029
|
+
expiryUnix: BigInt(expiryUnix),
|
|
26030
|
+
label
|
|
26031
|
+
}
|
|
26032
|
+
};
|
|
26033
|
+
}
|
|
26034
|
+
function rotatePqcKeyMsg(input) {
|
|
26035
|
+
const { sender, oldPublicKey, newPublicKey, oldSignature, newSignature } = input;
|
|
26036
|
+
return {
|
|
26037
|
+
typeUrl: "/qorechain.pqc.v1.MsgRotatePQCKey",
|
|
26038
|
+
value: {
|
|
26039
|
+
sender,
|
|
26040
|
+
oldPublicKey: toBytes3(oldPublicKey),
|
|
26041
|
+
newPublicKey: toBytes3(newPublicKey),
|
|
26042
|
+
oldSignature: toBytes3(oldSignature),
|
|
26043
|
+
newSignature: toBytes3(newSignature)
|
|
26044
|
+
}
|
|
26045
|
+
};
|
|
26046
|
+
}
|
|
26047
|
+
function walletPubkey(wallet) {
|
|
26048
|
+
const pk = wallet.publicKey;
|
|
26049
|
+
return pk instanceof Uint8Array ? pk : pk.toBytes();
|
|
26050
|
+
}
|
|
26051
|
+
function normalizeSignature(res) {
|
|
26052
|
+
return res instanceof Uint8Array ? res : res.signature;
|
|
26053
|
+
}
|
|
26054
|
+
async function buildPhantomExecuteEvm(opts) {
|
|
26055
|
+
const {
|
|
26056
|
+
wallet,
|
|
26057
|
+
relayer,
|
|
26058
|
+
chainId,
|
|
26059
|
+
account,
|
|
26060
|
+
to = "",
|
|
26061
|
+
value = "0",
|
|
26062
|
+
data = new Uint8Array(0),
|
|
26063
|
+
gasLimit = 1e5,
|
|
26064
|
+
nonce
|
|
26065
|
+
} = opts;
|
|
26066
|
+
const pubkey = walletPubkey(wallet);
|
|
26067
|
+
const digest = evmAuthSignBytes({ chainId, account, pubkey, to, value, data, nonce });
|
|
26068
|
+
const signature = normalizeSignature(await wallet.signMessage(digest));
|
|
26069
|
+
return executeEvmMsg({
|
|
26070
|
+
relayer,
|
|
26071
|
+
account,
|
|
26072
|
+
scheme: "ed25519",
|
|
26073
|
+
pubkey,
|
|
26074
|
+
signature,
|
|
26075
|
+
to,
|
|
26076
|
+
value,
|
|
26077
|
+
data,
|
|
26078
|
+
gasLimit,
|
|
26079
|
+
nonce
|
|
26080
|
+
});
|
|
26081
|
+
}
|
|
26082
|
+
async function buildPhantomExecuteCosmos(opts) {
|
|
26083
|
+
const { wallet, relayer, chainId, account, to, amount, nonce } = opts;
|
|
26084
|
+
const pubkey = walletPubkey(wallet);
|
|
26085
|
+
const digest = cosmosAuthSignBytes({ chainId, account, pubkey, to, amount, nonce });
|
|
26086
|
+
const signature = normalizeSignature(await wallet.signMessage(digest));
|
|
26087
|
+
return executeCosmosMsg({
|
|
26088
|
+
relayer,
|
|
26089
|
+
account,
|
|
26090
|
+
scheme: "ed25519",
|
|
26091
|
+
pubkey,
|
|
26092
|
+
signature,
|
|
26093
|
+
to,
|
|
26094
|
+
amount,
|
|
26095
|
+
nonce
|
|
26096
|
+
});
|
|
26097
|
+
}
|
|
26098
|
+
async function ethPersonalSign(provider, address, digest) {
|
|
26099
|
+
const sigHex = await provider.request({
|
|
26100
|
+
method: "personal_sign",
|
|
26101
|
+
params: [bytesToHex0x(digest), address]
|
|
26102
|
+
});
|
|
26103
|
+
return hexToBytes3(sigHex);
|
|
26104
|
+
}
|
|
26105
|
+
async function buildMetaMaskExecuteEvm(opts) {
|
|
26106
|
+
const {
|
|
26107
|
+
provider,
|
|
26108
|
+
address,
|
|
26109
|
+
relayer,
|
|
26110
|
+
chainId,
|
|
26111
|
+
account,
|
|
26112
|
+
to = "",
|
|
26113
|
+
value = "0",
|
|
26114
|
+
data = new Uint8Array(0),
|
|
26115
|
+
gasLimit = 1e5,
|
|
26116
|
+
nonce
|
|
26117
|
+
} = opts;
|
|
26118
|
+
const pubkey = hexToBytes3(address);
|
|
26119
|
+
const digest = evmAuthSignBytes({ chainId, account, pubkey, to, value, data, nonce });
|
|
26120
|
+
const signature = await ethPersonalSign(provider, address, digest);
|
|
26121
|
+
return executeEvmMsg({
|
|
26122
|
+
relayer,
|
|
26123
|
+
account,
|
|
26124
|
+
scheme: "secp256k1",
|
|
26125
|
+
pubkey,
|
|
26126
|
+
signature,
|
|
26127
|
+
to,
|
|
26128
|
+
value,
|
|
26129
|
+
data,
|
|
26130
|
+
gasLimit,
|
|
26131
|
+
nonce
|
|
26132
|
+
});
|
|
26133
|
+
}
|
|
26134
|
+
async function buildMetaMaskExecuteCosmos(opts) {
|
|
26135
|
+
const { provider, address, relayer, chainId, account, to, amount, nonce } = opts;
|
|
26136
|
+
const pubkey = hexToBytes3(address);
|
|
26137
|
+
const digest = cosmosAuthSignBytes({ chainId, account, pubkey, to, amount, nonce });
|
|
26138
|
+
const signature = await ethPersonalSign(provider, address, digest);
|
|
26139
|
+
return executeCosmosMsg({
|
|
26140
|
+
relayer,
|
|
26141
|
+
account,
|
|
26142
|
+
scheme: "secp256k1",
|
|
26143
|
+
pubkey,
|
|
26144
|
+
signature,
|
|
26145
|
+
to,
|
|
26146
|
+
amount,
|
|
26147
|
+
nonce
|
|
26148
|
+
});
|
|
26149
|
+
}
|
|
26150
|
+
var CANONICAL_DERIVATION = "adapter";
|
|
26151
|
+
var LEGACY_DERIVATION = "bridge";
|
|
26152
|
+
function derivePqcLegacy(mnemonic) {
|
|
26153
|
+
return generatePqcKeypair(shake256(enc2.encode(mnemonic), 32));
|
|
26154
|
+
}
|
|
26155
|
+
function derivePqcCanonical(account, mnemonic) {
|
|
26156
|
+
return generatePqcKeypair(
|
|
26157
|
+
shake256(enc2.encode(`qorechain:pqc:v1|${account}|${mnemonic}`), 32)
|
|
26158
|
+
);
|
|
26159
|
+
}
|
|
26160
|
+
function derivePqcByScheme(scheme, account, mnemonic) {
|
|
26161
|
+
if (scheme === LEGACY_DERIVATION || scheme === "mnemonic-only") {
|
|
26162
|
+
return derivePqcLegacy(mnemonic);
|
|
26163
|
+
}
|
|
26164
|
+
if (scheme === CANONICAL_DERIVATION || scheme === "") {
|
|
26165
|
+
return derivePqcCanonical(account, mnemonic);
|
|
26166
|
+
}
|
|
26167
|
+
throw new Error(`unknown derivation "${scheme}" (use adapter|bridge)`);
|
|
26168
|
+
}
|
|
26169
|
+
function rotatePqcKeyMsgFromMnemonic(opts) {
|
|
26170
|
+
const {
|
|
26171
|
+
account,
|
|
26172
|
+
mnemonic,
|
|
26173
|
+
chainId,
|
|
26174
|
+
algorithmId = 1,
|
|
26175
|
+
oldDerivation = LEGACY_DERIVATION,
|
|
26176
|
+
newDerivation = CANONICAL_DERIVATION
|
|
26177
|
+
} = opts;
|
|
26178
|
+
const oldKp = derivePqcByScheme(oldDerivation, account, mnemonic);
|
|
26179
|
+
const newKp = derivePqcByScheme(newDerivation, account, mnemonic);
|
|
26180
|
+
if (toHexLower2(oldKp.publicKey) === toHexLower2(newKp.publicKey)) {
|
|
26181
|
+
throw new Error(
|
|
26182
|
+
"old and new derivations produce the same key \u2014 rotation would be a no-op"
|
|
26183
|
+
);
|
|
26184
|
+
}
|
|
26185
|
+
const sb = enc2.encode(
|
|
26186
|
+
rotationSignBytes(chainId, algorithmId, account, oldKp.publicKey, newKp.publicKey)
|
|
26187
|
+
);
|
|
26188
|
+
const msg2 = rotatePqcKeyMsg({
|
|
26189
|
+
sender: account,
|
|
26190
|
+
oldPublicKey: oldKp.publicKey,
|
|
26191
|
+
newPublicKey: newKp.publicKey,
|
|
26192
|
+
oldSignature: mldsa.sign(oldKp.secretKey, sb),
|
|
26193
|
+
newSignature: mldsa.sign(newKp.secretKey, sb)
|
|
26194
|
+
});
|
|
26195
|
+
return { msg: msg2, oldKeypair: oldKp, newKeypair: newKp };
|
|
26196
|
+
}
|
|
24020
26197
|
|
|
24021
26198
|
// src/wallet/cosmos.ts
|
|
24022
26199
|
function suggestChainInfo(network) {
|
|
@@ -24105,6 +26282,13 @@ function createQueryClients(rpc) {
|
|
|
24105
26282
|
"Accounts",
|
|
24106
26283
|
QueryAccountsRequest,
|
|
24107
26284
|
QueryAccountsResponse
|
|
26285
|
+
),
|
|
26286
|
+
permissionSchema: unary(
|
|
26287
|
+
rpc,
|
|
26288
|
+
"qorechain.abstractaccount.v1.Query",
|
|
26289
|
+
"PermissionSchema",
|
|
26290
|
+
QueryPermissionSchemaRequest,
|
|
26291
|
+
QueryPermissionSchemaResponse
|
|
24108
26292
|
)
|
|
24109
26293
|
},
|
|
24110
26294
|
amm: {
|
|
@@ -24667,6 +26851,30 @@ function extractMessageIds(result) {
|
|
|
24667
26851
|
}
|
|
24668
26852
|
return ids;
|
|
24669
26853
|
}
|
|
26854
|
+
var CROSSVM_CALL_RESPONSE_TYPE_URL = "/qorechain.crossvm.v1.MsgCrossVMCallResponse";
|
|
26855
|
+
function unknownOutcome() {
|
|
26856
|
+
return { executed: false, data: new Uint8Array(0), gasUsed: 0n };
|
|
26857
|
+
}
|
|
26858
|
+
function decodeCallOutcomes(result) {
|
|
26859
|
+
const responses = result.msgResponses;
|
|
26860
|
+
if (!Array.isArray(responses)) return [];
|
|
26861
|
+
const out = [];
|
|
26862
|
+
for (const r of responses) {
|
|
26863
|
+
if (r?.typeUrl !== CROSSVM_CALL_RESPONSE_TYPE_URL) continue;
|
|
26864
|
+
try {
|
|
26865
|
+
const decoded = MsgCrossVMCallResponse.decode(r.value);
|
|
26866
|
+
out.push({
|
|
26867
|
+
executed: decoded.executed,
|
|
26868
|
+
data: decoded.data,
|
|
26869
|
+
// uint64 is generated as a decimal string; surface it as a bigint.
|
|
26870
|
+
gasUsed: BigInt(decoded.gasUsed ?? 0)
|
|
26871
|
+
});
|
|
26872
|
+
} catch {
|
|
26873
|
+
out.push(unknownOutcome());
|
|
26874
|
+
}
|
|
26875
|
+
}
|
|
26876
|
+
return out;
|
|
26877
|
+
}
|
|
24670
26878
|
function createCrossVMClient(tx, opts = {}) {
|
|
24671
26879
|
const sender = tx.senderAddress;
|
|
24672
26880
|
const query = opts.query;
|
|
@@ -24677,7 +26885,8 @@ function createCrossVMClient(tx, opts = {}) {
|
|
|
24677
26885
|
targetVm: o.targetVm,
|
|
24678
26886
|
targetContract: o.targetContract,
|
|
24679
26887
|
payload,
|
|
24680
|
-
funds: o.funds ?? []
|
|
26888
|
+
funds: o.funds ?? [],
|
|
26889
|
+
async: o.async ?? false
|
|
24681
26890
|
});
|
|
24682
26891
|
const buildCallSync = (o, payload) => buildFrom(o, payload);
|
|
24683
26892
|
const buildCall = (o) => {
|
|
@@ -24702,7 +26911,8 @@ function createCrossVMClient(tx, opts = {}) {
|
|
|
24702
26911
|
{ autoFee: o.autoFee }
|
|
24703
26912
|
);
|
|
24704
26913
|
const [messageId = ""] = extractMessageIds(result);
|
|
24705
|
-
|
|
26914
|
+
const [outcome = unknownOutcome()] = decodeCallOutcomes(result);
|
|
26915
|
+
return { messageId, ...outcome, result };
|
|
24706
26916
|
};
|
|
24707
26917
|
const callAtomic = async (calls, w = {}) => {
|
|
24708
26918
|
if (calls.length === 0) {
|
|
@@ -24717,7 +26927,11 @@ function createCrossVMClient(tx, opts = {}) {
|
|
|
24717
26927
|
w.memo ?? "",
|
|
24718
26928
|
{ autoFee: w.autoFee }
|
|
24719
26929
|
);
|
|
24720
|
-
return {
|
|
26930
|
+
return {
|
|
26931
|
+
messageIds: extractMessageIds(result),
|
|
26932
|
+
outcomes: decodeCallOutcomes(result),
|
|
26933
|
+
result
|
|
26934
|
+
};
|
|
24721
26935
|
};
|
|
24722
26936
|
const getMessage = (id) => {
|
|
24723
26937
|
requireGetMessageSource(query, qor);
|
|
@@ -24821,8 +27035,8 @@ async function migrateToHybrid(tx, opts) {
|
|
|
24821
27035
|
}
|
|
24822
27036
|
|
|
24823
27037
|
// src/index.ts
|
|
24824
|
-
var VERSION = "0.
|
|
27038
|
+
var VERSION = "0.8.0";
|
|
24825
27039
|
|
|
24826
|
-
export { AlgorithmDilithium5, AlgorithmMLKEM1024, AlgorithmUnspecified, DEFAULT_GAS_MULTIPLIER, DEFAULT_GAS_PRICE, ETHSECP256K1_PUBKEY_TYPE, EthNativeSigner, GasPrice, HYBRID_SIG_TYPE_URL, HybridSigner, JsonRpcClient, JsonRpcError, ML_DSA_87_PUBLIC_KEY_LENGTH, ML_DSA_87_SECRET_KEY_LENGTH, ML_DSA_87_SEED_LENGTH, ML_DSA_87_SIGNATURE_LENGTH, MSG_SEND_TYPE_URL, NETWORKS,
|
|
27040
|
+
export { AlgorithmDilithium5, AlgorithmMLKEM1024, AlgorithmUnspecified, BRIDGE_ATTESTATION_V2_DOMAIN, CANONICAL_DERIVATION, DEFAULT_GAS_MULTIPLIER, DEFAULT_GAS_PRICE, ETHSECP256K1_PUBKEY_TYPE, EthNativeSigner, GasPrice, HYBRID_SIGN_BYTES_REJECTION_LOG, HYBRID_SIGN_BYTES_V2_DOMAIN, HYBRID_SIG_TYPE_URL, HybridSigner, JsonRpcClient, JsonRpcError, LEGACY_DERIVATION, LEGACY_SIGN_BYTES_CHAINS, MIGRATION_SIGN_BYTES_V2_DOMAIN, ML_DSA_87_PUBLIC_KEY_LENGTH, ML_DSA_87_SECRET_KEY_LENGTH, ML_DSA_87_SEED_LENGTH, ML_DSA_87_SIGNATURE_LENGTH, MSG_SEND_TYPE_URL, NETWORKS, PQC_KEY_STATUS_PRECOMPILE_ADDRESS, PqcSigner, QorClient, QoreHttpError, QoreTxError, RestClient, SIGN_BYTES_V2_UPGRADE, STATIC_FALLBACK, TxClient, VERSION, VM_TYPES, abstractaccount, accountAuthInfo, addressesFrom20, algorithmName, amm, attachHybridExtension, authz, bank, be64, bech32ToHex, bridge, bridgeAttestationSignBytes, bridgeAttestationSignBytesV1, bridgeAttestationSignBytesV2, broadcastAndWait, buildAminoTypes, buildEventsQuery, buildHybridSignatureExtension, buildHybridTx, buildMetaMaskExecuteCosmos, buildMetaMaskExecuteEvm, buildPhantomExecuteCosmos, buildPhantomExecuteEvm, buildRegisterPqcKeyMsg, buildTxQuery, buildUrl, bytesToBech32, calculateFee, clearAdmin, clearSignBytesCache, connectCosmWasmSigner, connectPhantomUnified, connectQueryClients, cosmosAuthSignBytes, createClient, createCosmWasmClient, createCrossVMClient, createMultilayerClient, createQueryClients, createRollupClient, createSubscriptionClient, crossvm, decodeTxError, deriveEvmAccount, deriveNativeAccount, derivePqcLegacy, deriveSvmAccount, deriveUnifiedAccount, directSignerFromPrivateKey, distribution, encodeHybridExtension, ensurePqcRegistered, estimateFee, evmAuthSignBytes, evmToQor, execute, executeCosmosMsg, executeEvmMsg, explorerAddressUrl, explorerBlockUrl, explorerTxUrl, feegrant, fetchSignBytesV2AppliedHeight, formatUnits, fromBase, generateMnemonic, generatePqcKeypair, getBlock, getCodeDetails, getCodes, getContractInfo, getContracts, getCosmosWallet, getCrossVmMessage, getCrossVmParams, getJson, getLatestBlock, getNetwork, getPendingCrossVmMessages, getPqcStatus, getTx, gov, hexToBech32, hybridSignBytes, hybridSignBytesV1, hybridSignBytesV2, ibc, instantiate, instantiate2, isChecksumAddress, isHybridSignBytesRejection, isLegacySignBytesChain, isPqcRegistered, isSignatureAlgorithm, isTxFailure, isValidBech32, isValidEvmAddress, isValidSvmAddress, joinUrl, keccak256, keccak256Hex, lengthPrefixed, license, lightnode, listNetworks, migrate, migratePqcKey, migrateToHybrid, migrationSignBytes, migrationSignBytesV1, migrationSignBytesV2, msg, multilayer, parseEthPubkeyAny, parseUnits, postJsonRpc, pqc as pqcMsg, pqcSign, pqcVerify, qorToEvm, qoreAddresses, qorechainRegistry, qorechainRegistryTypes, codegen_exports as qorechainTypes, queryContractSmart, rdk, registerEthAuthenticatorMsg, requestFaucet, resolveSignBytesVersion, revokeAuthenticatorMsg, ripemd160, ripemd160Hex, rlconsensus, rotatePqcKeyMsg, rotatePqcKeyMsgFromMnemonic, rotationSignBytes, searchTxs, sha256, sha256Hex, signAndBroadcastHybrid, signBytesVersionFor, signClassicalEth, signHybridEth, staking, subscribeNewBlocks, subscribeTx, suggestChainInfo, svm, toBase, toChecksumAddress, toHex, txErrorFrom, unifiedAccountFromPhantomSignature, unifiedAccountFromSeed, updateAdmin, uploadCode, validateMnemonic, waitForTx, withRetry2 as withRetry };
|
|
24827
27041
|
//# sourceMappingURL=index.js.map
|
|
24828
27042
|
//# sourceMappingURL=index.js.map
|