@qorechain/sdk 0.6.1 → 0.7.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/dist/index.cjs CHANGED
@@ -278,6 +278,35 @@ var RestClient = class {
278
278
  getInflationRate() {
279
279
  return this.get("/qorechain/inflation/v1/rate");
280
280
  }
281
+ // --- Abstract-account authenticator lanes (v3.1.85) ----------------------
282
+ /**
283
+ * The canonical authenticator permission taxonomy
284
+ * (`/qorechain/abstractaccount/v1/permission_schema`): the valid permission
285
+ * strings, the message-typeURL→permission mapping, the never-delegable
286
+ * key-management typeURLs, and a `schema_version` for drift detection.
287
+ */
288
+ getPermissionSchema() {
289
+ return this.get(
290
+ "/qorechain/abstractaccount/v1/permission_schema"
291
+ );
292
+ }
293
+ /** Abstract-account module config (`/qorechain/abstractaccount/v1/config`). */
294
+ getAbstractAccountConfig() {
295
+ return this.get("/qorechain/abstractaccount/v1/config");
296
+ }
297
+ /** All abstract accounts (`/qorechain/abstractaccount/v1/accounts`). */
298
+ getAbstractAccounts() {
299
+ return this.get("/qorechain/abstractaccount/v1/accounts");
300
+ }
301
+ /**
302
+ * A single abstract account by address
303
+ * (`/qorechain/abstractaccount/v1/accounts/{address}`).
304
+ */
305
+ getAbstractAccount(address) {
306
+ return this.get(
307
+ `/qorechain/abstractaccount/v1/accounts/${encodeURIComponent(address)}`
308
+ );
309
+ }
281
310
  };
282
311
 
283
312
  // src/query/jsonrpc.ts
@@ -5751,6 +5780,8 @@ __export(tx_exports5, {
5751
5780
  MsgRegisterPQCKeyResponse: () => MsgRegisterPQCKeyResponse,
5752
5781
  MsgRegisterPQCKeyV2: () => MsgRegisterPQCKeyV2,
5753
5782
  MsgRegisterPQCKeyV2Response: () => MsgRegisterPQCKeyV2Response,
5783
+ MsgRotatePQCKey: () => MsgRotatePQCKey,
5784
+ MsgRotatePQCKeyResponse: () => MsgRotatePQCKeyResponse,
5754
5785
  protobufPackage: () => protobufPackage5
5755
5786
  });
5756
5787
  var protobufPackage5 = "qorechain.pqc.v1";
@@ -6205,6 +6236,160 @@ var MsgMigratePQCKeyResponse = {
6205
6236
  return message;
6206
6237
  }
6207
6238
  };
6239
+ function createBaseMsgRotatePQCKey() {
6240
+ return {
6241
+ sender: "",
6242
+ oldPublicKey: new Uint8Array(0),
6243
+ newPublicKey: new Uint8Array(0),
6244
+ oldSignature: new Uint8Array(0),
6245
+ newSignature: new Uint8Array(0)
6246
+ };
6247
+ }
6248
+ var MsgRotatePQCKey = {
6249
+ encode(message, writer = new wire.BinaryWriter()) {
6250
+ if (message.sender !== "") {
6251
+ writer.uint32(10).string(message.sender);
6252
+ }
6253
+ if (message.oldPublicKey.length !== 0) {
6254
+ writer.uint32(18).bytes(message.oldPublicKey);
6255
+ }
6256
+ if (message.newPublicKey.length !== 0) {
6257
+ writer.uint32(26).bytes(message.newPublicKey);
6258
+ }
6259
+ if (message.oldSignature.length !== 0) {
6260
+ writer.uint32(34).bytes(message.oldSignature);
6261
+ }
6262
+ if (message.newSignature.length !== 0) {
6263
+ writer.uint32(42).bytes(message.newSignature);
6264
+ }
6265
+ return writer;
6266
+ },
6267
+ decode(input, length) {
6268
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
6269
+ const end = length === void 0 ? reader.len : reader.pos + length;
6270
+ const message = createBaseMsgRotatePQCKey();
6271
+ while (reader.pos < end) {
6272
+ const tag = reader.uint32();
6273
+ switch (tag >>> 3) {
6274
+ case 1: {
6275
+ if (tag !== 10) {
6276
+ break;
6277
+ }
6278
+ message.sender = reader.string();
6279
+ continue;
6280
+ }
6281
+ case 2: {
6282
+ if (tag !== 18) {
6283
+ break;
6284
+ }
6285
+ message.oldPublicKey = reader.bytes();
6286
+ continue;
6287
+ }
6288
+ case 3: {
6289
+ if (tag !== 26) {
6290
+ break;
6291
+ }
6292
+ message.newPublicKey = reader.bytes();
6293
+ continue;
6294
+ }
6295
+ case 4: {
6296
+ if (tag !== 34) {
6297
+ break;
6298
+ }
6299
+ message.oldSignature = reader.bytes();
6300
+ continue;
6301
+ }
6302
+ case 5: {
6303
+ if (tag !== 42) {
6304
+ break;
6305
+ }
6306
+ message.newSignature = reader.bytes();
6307
+ continue;
6308
+ }
6309
+ }
6310
+ if ((tag & 7) === 4 || tag === 0) {
6311
+ break;
6312
+ }
6313
+ reader.skip(tag & 7);
6314
+ }
6315
+ return message;
6316
+ },
6317
+ fromJSON(object) {
6318
+ return {
6319
+ sender: isSet6(object.sender) ? globalThis.String(object.sender) : "",
6320
+ oldPublicKey: isSet6(object.oldPublicKey) ? bytesFromBase644(object.oldPublicKey) : isSet6(object.old_public_key) ? bytesFromBase644(object.old_public_key) : new Uint8Array(0),
6321
+ newPublicKey: isSet6(object.newPublicKey) ? bytesFromBase644(object.newPublicKey) : isSet6(object.new_public_key) ? bytesFromBase644(object.new_public_key) : new Uint8Array(0),
6322
+ oldSignature: isSet6(object.oldSignature) ? bytesFromBase644(object.oldSignature) : isSet6(object.old_signature) ? bytesFromBase644(object.old_signature) : new Uint8Array(0),
6323
+ newSignature: isSet6(object.newSignature) ? bytesFromBase644(object.newSignature) : isSet6(object.new_signature) ? bytesFromBase644(object.new_signature) : new Uint8Array(0)
6324
+ };
6325
+ },
6326
+ toJSON(message) {
6327
+ const obj = {};
6328
+ if (message.sender !== "") {
6329
+ obj.sender = message.sender;
6330
+ }
6331
+ if (message.oldPublicKey.length !== 0) {
6332
+ obj.oldPublicKey = base64FromBytes4(message.oldPublicKey);
6333
+ }
6334
+ if (message.newPublicKey.length !== 0) {
6335
+ obj.newPublicKey = base64FromBytes4(message.newPublicKey);
6336
+ }
6337
+ if (message.oldSignature.length !== 0) {
6338
+ obj.oldSignature = base64FromBytes4(message.oldSignature);
6339
+ }
6340
+ if (message.newSignature.length !== 0) {
6341
+ obj.newSignature = base64FromBytes4(message.newSignature);
6342
+ }
6343
+ return obj;
6344
+ },
6345
+ create(base) {
6346
+ return MsgRotatePQCKey.fromPartial(base ?? {});
6347
+ },
6348
+ fromPartial(object) {
6349
+ const message = createBaseMsgRotatePQCKey();
6350
+ message.sender = object.sender ?? "";
6351
+ message.oldPublicKey = object.oldPublicKey ?? new Uint8Array(0);
6352
+ message.newPublicKey = object.newPublicKey ?? new Uint8Array(0);
6353
+ message.oldSignature = object.oldSignature ?? new Uint8Array(0);
6354
+ message.newSignature = object.newSignature ?? new Uint8Array(0);
6355
+ return message;
6356
+ }
6357
+ };
6358
+ function createBaseMsgRotatePQCKeyResponse() {
6359
+ return {};
6360
+ }
6361
+ var MsgRotatePQCKeyResponse = {
6362
+ encode(_, writer = new wire.BinaryWriter()) {
6363
+ return writer;
6364
+ },
6365
+ decode(input, length) {
6366
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
6367
+ const end = length === void 0 ? reader.len : reader.pos + length;
6368
+ const message = createBaseMsgRotatePQCKeyResponse();
6369
+ while (reader.pos < end) {
6370
+ const tag = reader.uint32();
6371
+ if ((tag & 7) === 4 || tag === 0) {
6372
+ break;
6373
+ }
6374
+ reader.skip(tag & 7);
6375
+ }
6376
+ return message;
6377
+ },
6378
+ fromJSON(_) {
6379
+ return {};
6380
+ },
6381
+ toJSON(_) {
6382
+ const obj = {};
6383
+ return obj;
6384
+ },
6385
+ create(base) {
6386
+ return MsgRotatePQCKeyResponse.fromPartial(base ?? {});
6387
+ },
6388
+ fromPartial(_) {
6389
+ const message = createBaseMsgRotatePQCKeyResponse();
6390
+ return message;
6391
+ }
6392
+ };
6208
6393
  function createBaseMsgDeprecateAlgorithm() {
6209
6394
  return { authority: "", algorithmId: 0, migrationBlocks: "0", replacementAlgorithmId: 0 };
6210
6395
  }
@@ -6487,6 +6672,20 @@ var MsgDefinition5 = {
6487
6672
  responseStream: false,
6488
6673
  options: {}
6489
6674
  },
6675
+ /**
6676
+ * RotatePQCKey replaces an account's PQC key with a NEW key of the SAME
6677
+ * algorithm — for rotating a compromised key or moving a legacy-derived key to
6678
+ * the canonical derivation. Dual-signed (old proves ownership, new proves
6679
+ * control); needs no active algorithm migration.
6680
+ */
6681
+ rotatePQCKey: {
6682
+ name: "RotatePQCKey",
6683
+ requestType: MsgRotatePQCKey,
6684
+ requestStream: false,
6685
+ responseType: MsgRotatePQCKeyResponse,
6686
+ responseStream: false,
6687
+ options: {}
6688
+ },
6490
6689
  /** DeprecateAlgorithm starts the migration period for an algorithm (governance). */
6491
6690
  deprecateAlgorithm: {
6492
6691
  name: "DeprecateAlgorithm",
@@ -8361,6 +8560,10 @@ __export(tx_exports9, {
8361
8560
  MsgCreateAbstractAccount: () => MsgCreateAbstractAccount,
8362
8561
  MsgCreateAbstractAccountResponse: () => MsgCreateAbstractAccountResponse,
8363
8562
  MsgDefinition: () => MsgDefinition9,
8563
+ MsgExecuteCosmos: () => MsgExecuteCosmos,
8564
+ MsgExecuteCosmosResponse: () => MsgExecuteCosmosResponse,
8565
+ MsgExecuteEVM: () => MsgExecuteEVM,
8566
+ MsgExecuteEVMResponse: () => MsgExecuteEVMResponse,
8364
8567
  MsgRegisterAuthenticator: () => MsgRegisterAuthenticator,
8365
8568
  MsgRegisterAuthenticatorResponse: () => MsgRegisterAuthenticatorResponse,
8366
8569
  MsgRevokeAuthenticator: () => MsgRevokeAuthenticator,
@@ -9040,95 +9243,626 @@ var MsgRevokeAuthenticatorResponse = {
9040
9243
  return message;
9041
9244
  }
9042
9245
  };
9043
- var MsgDefinition9 = {
9044
- name: "Msg",
9045
- fullName: "qorechain.abstractaccount.v1.Msg",
9046
- methods: {
9047
- createAbstractAccount: {
9048
- name: "CreateAbstractAccount",
9049
- requestType: MsgCreateAbstractAccount,
9050
- requestStream: false,
9051
- responseType: MsgCreateAbstractAccountResponse,
9052
- responseStream: false,
9053
- options: {}
9054
- },
9055
- updateSpendingRules: {
9056
- name: "UpdateSpendingRules",
9057
- requestType: MsgUpdateSpendingRules,
9058
- requestStream: false,
9059
- responseType: MsgUpdateSpendingRulesResponse,
9060
- responseStream: false,
9061
- options: {}
9062
- },
9063
- registerAuthenticator: {
9064
- name: "RegisterAuthenticator",
9065
- requestType: MsgRegisterAuthenticator,
9066
- requestStream: false,
9067
- responseType: MsgRegisterAuthenticatorResponse,
9068
- responseStream: false,
9069
- options: {}
9070
- },
9071
- revokeAuthenticator: {
9072
- name: "RevokeAuthenticator",
9073
- requestType: MsgRevokeAuthenticator,
9074
- requestStream: false,
9075
- responseType: MsgRevokeAuthenticatorResponse,
9076
- responseStream: false,
9077
- options: {}
9078
- }
9079
- }
9080
- };
9081
- function bytesFromBase646(b64) {
9082
- if (globalThis.Buffer) {
9083
- return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
9084
- } else {
9085
- const bin = globalThis.atob(b64);
9086
- const arr = new Uint8Array(bin.length);
9087
- for (let i = 0; i < bin.length; ++i) {
9088
- arr[i] = bin.charCodeAt(i);
9089
- }
9090
- return arr;
9091
- }
9092
- }
9093
- function base64FromBytes6(arr) {
9094
- if (globalThis.Buffer) {
9095
- return globalThis.Buffer.from(arr).toString("base64");
9096
- } else {
9097
- const bin = [];
9098
- arr.forEach((byte) => {
9099
- bin.push(globalThis.String.fromCharCode(byte));
9100
- });
9101
- return globalThis.btoa(bin.join(""));
9102
- }
9103
- }
9104
- function isSet10(value) {
9105
- return value !== null && value !== void 0;
9106
- }
9107
-
9108
- // src/codegen/qorechain/crossvm/v1/tx.ts
9109
- var tx_exports10 = {};
9110
- __export(tx_exports10, {
9111
- MsgCrossVMCall: () => MsgCrossVMCall,
9112
- MsgCrossVMCallResponse: () => MsgCrossVMCallResponse,
9113
- MsgDefinition: () => MsgDefinition10,
9114
- MsgProcessQueue: () => MsgProcessQueue,
9115
- MsgProcessQueueResponse: () => MsgProcessQueueResponse,
9116
- protobufPackage: () => protobufPackage10
9117
- });
9118
- var protobufPackage10 = "qorechain.crossvm.v1";
9119
- function createBaseMsgCrossVMCall() {
9120
- return { sender: "", sourceVm: "", targetVm: "", targetContract: "", payload: new Uint8Array(0), funds: [] };
9246
+ function createBaseMsgExecuteEVM() {
9247
+ return {
9248
+ relayer: "",
9249
+ account: "",
9250
+ scheme: "",
9251
+ pubkey: new Uint8Array(0),
9252
+ signature: new Uint8Array(0),
9253
+ to: "",
9254
+ value: "",
9255
+ data: new Uint8Array(0),
9256
+ gasLimit: "0",
9257
+ nonce: "0"
9258
+ };
9121
9259
  }
9122
- var MsgCrossVMCall = {
9260
+ var MsgExecuteEVM = {
9123
9261
  encode(message, writer = new wire.BinaryWriter()) {
9124
- if (message.sender !== "") {
9125
- writer.uint32(10).string(message.sender);
9262
+ if (message.relayer !== "") {
9263
+ writer.uint32(10).string(message.relayer);
9126
9264
  }
9127
- if (message.sourceVm !== "") {
9128
- writer.uint32(18).string(message.sourceVm);
9265
+ if (message.account !== "") {
9266
+ writer.uint32(18).string(message.account);
9129
9267
  }
9130
- if (message.targetVm !== "") {
9131
- writer.uint32(26).string(message.targetVm);
9268
+ if (message.scheme !== "") {
9269
+ writer.uint32(26).string(message.scheme);
9270
+ }
9271
+ if (message.pubkey.length !== 0) {
9272
+ writer.uint32(34).bytes(message.pubkey);
9273
+ }
9274
+ if (message.signature.length !== 0) {
9275
+ writer.uint32(42).bytes(message.signature);
9276
+ }
9277
+ if (message.to !== "") {
9278
+ writer.uint32(50).string(message.to);
9279
+ }
9280
+ if (message.value !== "") {
9281
+ writer.uint32(58).string(message.value);
9282
+ }
9283
+ if (message.data.length !== 0) {
9284
+ writer.uint32(66).bytes(message.data);
9285
+ }
9286
+ if (message.gasLimit !== "0") {
9287
+ writer.uint32(72).uint64(message.gasLimit);
9288
+ }
9289
+ if (message.nonce !== "0") {
9290
+ writer.uint32(80).uint64(message.nonce);
9291
+ }
9292
+ return writer;
9293
+ },
9294
+ decode(input, length) {
9295
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
9296
+ const end = length === void 0 ? reader.len : reader.pos + length;
9297
+ const message = createBaseMsgExecuteEVM();
9298
+ while (reader.pos < end) {
9299
+ const tag = reader.uint32();
9300
+ switch (tag >>> 3) {
9301
+ case 1: {
9302
+ if (tag !== 10) {
9303
+ break;
9304
+ }
9305
+ message.relayer = reader.string();
9306
+ continue;
9307
+ }
9308
+ case 2: {
9309
+ if (tag !== 18) {
9310
+ break;
9311
+ }
9312
+ message.account = reader.string();
9313
+ continue;
9314
+ }
9315
+ case 3: {
9316
+ if (tag !== 26) {
9317
+ break;
9318
+ }
9319
+ message.scheme = reader.string();
9320
+ continue;
9321
+ }
9322
+ case 4: {
9323
+ if (tag !== 34) {
9324
+ break;
9325
+ }
9326
+ message.pubkey = reader.bytes();
9327
+ continue;
9328
+ }
9329
+ case 5: {
9330
+ if (tag !== 42) {
9331
+ break;
9332
+ }
9333
+ message.signature = reader.bytes();
9334
+ continue;
9335
+ }
9336
+ case 6: {
9337
+ if (tag !== 50) {
9338
+ break;
9339
+ }
9340
+ message.to = reader.string();
9341
+ continue;
9342
+ }
9343
+ case 7: {
9344
+ if (tag !== 58) {
9345
+ break;
9346
+ }
9347
+ message.value = reader.string();
9348
+ continue;
9349
+ }
9350
+ case 8: {
9351
+ if (tag !== 66) {
9352
+ break;
9353
+ }
9354
+ message.data = reader.bytes();
9355
+ continue;
9356
+ }
9357
+ case 9: {
9358
+ if (tag !== 72) {
9359
+ break;
9360
+ }
9361
+ message.gasLimit = reader.uint64().toString();
9362
+ continue;
9363
+ }
9364
+ case 10: {
9365
+ if (tag !== 80) {
9366
+ break;
9367
+ }
9368
+ message.nonce = reader.uint64().toString();
9369
+ continue;
9370
+ }
9371
+ }
9372
+ if ((tag & 7) === 4 || tag === 0) {
9373
+ break;
9374
+ }
9375
+ reader.skip(tag & 7);
9376
+ }
9377
+ return message;
9378
+ },
9379
+ fromJSON(object) {
9380
+ return {
9381
+ relayer: isSet10(object.relayer) ? globalThis.String(object.relayer) : "",
9382
+ account: isSet10(object.account) ? globalThis.String(object.account) : "",
9383
+ scheme: isSet10(object.scheme) ? globalThis.String(object.scheme) : "",
9384
+ pubkey: isSet10(object.pubkey) ? bytesFromBase646(object.pubkey) : new Uint8Array(0),
9385
+ signature: isSet10(object.signature) ? bytesFromBase646(object.signature) : new Uint8Array(0),
9386
+ to: isSet10(object.to) ? globalThis.String(object.to) : "",
9387
+ value: isSet10(object.value) ? globalThis.String(object.value) : "",
9388
+ data: isSet10(object.data) ? bytesFromBase646(object.data) : new Uint8Array(0),
9389
+ gasLimit: isSet10(object.gasLimit) ? globalThis.String(object.gasLimit) : isSet10(object.gas_limit) ? globalThis.String(object.gas_limit) : "0",
9390
+ nonce: isSet10(object.nonce) ? globalThis.String(object.nonce) : "0"
9391
+ };
9392
+ },
9393
+ toJSON(message) {
9394
+ const obj = {};
9395
+ if (message.relayer !== "") {
9396
+ obj.relayer = message.relayer;
9397
+ }
9398
+ if (message.account !== "") {
9399
+ obj.account = message.account;
9400
+ }
9401
+ if (message.scheme !== "") {
9402
+ obj.scheme = message.scheme;
9403
+ }
9404
+ if (message.pubkey.length !== 0) {
9405
+ obj.pubkey = base64FromBytes6(message.pubkey);
9406
+ }
9407
+ if (message.signature.length !== 0) {
9408
+ obj.signature = base64FromBytes6(message.signature);
9409
+ }
9410
+ if (message.to !== "") {
9411
+ obj.to = message.to;
9412
+ }
9413
+ if (message.value !== "") {
9414
+ obj.value = message.value;
9415
+ }
9416
+ if (message.data.length !== 0) {
9417
+ obj.data = base64FromBytes6(message.data);
9418
+ }
9419
+ if (message.gasLimit !== "0") {
9420
+ obj.gasLimit = message.gasLimit;
9421
+ }
9422
+ if (message.nonce !== "0") {
9423
+ obj.nonce = message.nonce;
9424
+ }
9425
+ return obj;
9426
+ },
9427
+ create(base) {
9428
+ return MsgExecuteEVM.fromPartial(base ?? {});
9429
+ },
9430
+ fromPartial(object) {
9431
+ const message = createBaseMsgExecuteEVM();
9432
+ message.relayer = object.relayer ?? "";
9433
+ message.account = object.account ?? "";
9434
+ message.scheme = object.scheme ?? "";
9435
+ message.pubkey = object.pubkey ?? new Uint8Array(0);
9436
+ message.signature = object.signature ?? new Uint8Array(0);
9437
+ message.to = object.to ?? "";
9438
+ message.value = object.value ?? "";
9439
+ message.data = object.data ?? new Uint8Array(0);
9440
+ message.gasLimit = object.gasLimit ?? "0";
9441
+ message.nonce = object.nonce ?? "0";
9442
+ return message;
9443
+ }
9444
+ };
9445
+ function createBaseMsgExecuteEVMResponse() {
9446
+ return { success: false, ret: new Uint8Array(0), gasUsed: "0", vmError: "" };
9447
+ }
9448
+ var MsgExecuteEVMResponse = {
9449
+ encode(message, writer = new wire.BinaryWriter()) {
9450
+ if (message.success !== false) {
9451
+ writer.uint32(8).bool(message.success);
9452
+ }
9453
+ if (message.ret.length !== 0) {
9454
+ writer.uint32(18).bytes(message.ret);
9455
+ }
9456
+ if (message.gasUsed !== "0") {
9457
+ writer.uint32(24).uint64(message.gasUsed);
9458
+ }
9459
+ if (message.vmError !== "") {
9460
+ writer.uint32(34).string(message.vmError);
9461
+ }
9462
+ return writer;
9463
+ },
9464
+ decode(input, length) {
9465
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
9466
+ const end = length === void 0 ? reader.len : reader.pos + length;
9467
+ const message = createBaseMsgExecuteEVMResponse();
9468
+ while (reader.pos < end) {
9469
+ const tag = reader.uint32();
9470
+ switch (tag >>> 3) {
9471
+ case 1: {
9472
+ if (tag !== 8) {
9473
+ break;
9474
+ }
9475
+ message.success = reader.bool();
9476
+ continue;
9477
+ }
9478
+ case 2: {
9479
+ if (tag !== 18) {
9480
+ break;
9481
+ }
9482
+ message.ret = reader.bytes();
9483
+ continue;
9484
+ }
9485
+ case 3: {
9486
+ if (tag !== 24) {
9487
+ break;
9488
+ }
9489
+ message.gasUsed = reader.uint64().toString();
9490
+ continue;
9491
+ }
9492
+ case 4: {
9493
+ if (tag !== 34) {
9494
+ break;
9495
+ }
9496
+ message.vmError = reader.string();
9497
+ continue;
9498
+ }
9499
+ }
9500
+ if ((tag & 7) === 4 || tag === 0) {
9501
+ break;
9502
+ }
9503
+ reader.skip(tag & 7);
9504
+ }
9505
+ return message;
9506
+ },
9507
+ fromJSON(object) {
9508
+ return {
9509
+ success: isSet10(object.success) ? globalThis.Boolean(object.success) : false,
9510
+ ret: isSet10(object.ret) ? bytesFromBase646(object.ret) : new Uint8Array(0),
9511
+ gasUsed: isSet10(object.gasUsed) ? globalThis.String(object.gasUsed) : isSet10(object.gas_used) ? globalThis.String(object.gas_used) : "0",
9512
+ vmError: isSet10(object.vmError) ? globalThis.String(object.vmError) : isSet10(object.vm_error) ? globalThis.String(object.vm_error) : ""
9513
+ };
9514
+ },
9515
+ toJSON(message) {
9516
+ const obj = {};
9517
+ if (message.success !== false) {
9518
+ obj.success = message.success;
9519
+ }
9520
+ if (message.ret.length !== 0) {
9521
+ obj.ret = base64FromBytes6(message.ret);
9522
+ }
9523
+ if (message.gasUsed !== "0") {
9524
+ obj.gasUsed = message.gasUsed;
9525
+ }
9526
+ if (message.vmError !== "") {
9527
+ obj.vmError = message.vmError;
9528
+ }
9529
+ return obj;
9530
+ },
9531
+ create(base) {
9532
+ return MsgExecuteEVMResponse.fromPartial(base ?? {});
9533
+ },
9534
+ fromPartial(object) {
9535
+ const message = createBaseMsgExecuteEVMResponse();
9536
+ message.success = object.success ?? false;
9537
+ message.ret = object.ret ?? new Uint8Array(0);
9538
+ message.gasUsed = object.gasUsed ?? "0";
9539
+ message.vmError = object.vmError ?? "";
9540
+ return message;
9541
+ }
9542
+ };
9543
+ function createBaseMsgExecuteCosmos() {
9544
+ return {
9545
+ relayer: "",
9546
+ account: "",
9547
+ scheme: "",
9548
+ pubkey: new Uint8Array(0),
9549
+ signature: new Uint8Array(0),
9550
+ to: "",
9551
+ amount: [],
9552
+ nonce: "0"
9553
+ };
9554
+ }
9555
+ var MsgExecuteCosmos = {
9556
+ encode(message, writer = new wire.BinaryWriter()) {
9557
+ if (message.relayer !== "") {
9558
+ writer.uint32(10).string(message.relayer);
9559
+ }
9560
+ if (message.account !== "") {
9561
+ writer.uint32(18).string(message.account);
9562
+ }
9563
+ if (message.scheme !== "") {
9564
+ writer.uint32(26).string(message.scheme);
9565
+ }
9566
+ if (message.pubkey.length !== 0) {
9567
+ writer.uint32(34).bytes(message.pubkey);
9568
+ }
9569
+ if (message.signature.length !== 0) {
9570
+ writer.uint32(42).bytes(message.signature);
9571
+ }
9572
+ if (message.to !== "") {
9573
+ writer.uint32(50).string(message.to);
9574
+ }
9575
+ for (const v of message.amount) {
9576
+ Coin.encode(v, writer.uint32(58).fork()).join();
9577
+ }
9578
+ if (message.nonce !== "0") {
9579
+ writer.uint32(64).uint64(message.nonce);
9580
+ }
9581
+ return writer;
9582
+ },
9583
+ decode(input, length) {
9584
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
9585
+ const end = length === void 0 ? reader.len : reader.pos + length;
9586
+ const message = createBaseMsgExecuteCosmos();
9587
+ while (reader.pos < end) {
9588
+ const tag = reader.uint32();
9589
+ switch (tag >>> 3) {
9590
+ case 1: {
9591
+ if (tag !== 10) {
9592
+ break;
9593
+ }
9594
+ message.relayer = reader.string();
9595
+ continue;
9596
+ }
9597
+ case 2: {
9598
+ if (tag !== 18) {
9599
+ break;
9600
+ }
9601
+ message.account = reader.string();
9602
+ continue;
9603
+ }
9604
+ case 3: {
9605
+ if (tag !== 26) {
9606
+ break;
9607
+ }
9608
+ message.scheme = reader.string();
9609
+ continue;
9610
+ }
9611
+ case 4: {
9612
+ if (tag !== 34) {
9613
+ break;
9614
+ }
9615
+ message.pubkey = reader.bytes();
9616
+ continue;
9617
+ }
9618
+ case 5: {
9619
+ if (tag !== 42) {
9620
+ break;
9621
+ }
9622
+ message.signature = reader.bytes();
9623
+ continue;
9624
+ }
9625
+ case 6: {
9626
+ if (tag !== 50) {
9627
+ break;
9628
+ }
9629
+ message.to = reader.string();
9630
+ continue;
9631
+ }
9632
+ case 7: {
9633
+ if (tag !== 58) {
9634
+ break;
9635
+ }
9636
+ message.amount.push(Coin.decode(reader, reader.uint32()));
9637
+ continue;
9638
+ }
9639
+ case 8: {
9640
+ if (tag !== 64) {
9641
+ break;
9642
+ }
9643
+ message.nonce = reader.uint64().toString();
9644
+ continue;
9645
+ }
9646
+ }
9647
+ if ((tag & 7) === 4 || tag === 0) {
9648
+ break;
9649
+ }
9650
+ reader.skip(tag & 7);
9651
+ }
9652
+ return message;
9653
+ },
9654
+ fromJSON(object) {
9655
+ return {
9656
+ relayer: isSet10(object.relayer) ? globalThis.String(object.relayer) : "",
9657
+ account: isSet10(object.account) ? globalThis.String(object.account) : "",
9658
+ scheme: isSet10(object.scheme) ? globalThis.String(object.scheme) : "",
9659
+ pubkey: isSet10(object.pubkey) ? bytesFromBase646(object.pubkey) : new Uint8Array(0),
9660
+ signature: isSet10(object.signature) ? bytesFromBase646(object.signature) : new Uint8Array(0),
9661
+ to: isSet10(object.to) ? globalThis.String(object.to) : "",
9662
+ amount: globalThis.Array.isArray(object?.amount) ? object.amount.map((e) => Coin.fromJSON(e)) : [],
9663
+ nonce: isSet10(object.nonce) ? globalThis.String(object.nonce) : "0"
9664
+ };
9665
+ },
9666
+ toJSON(message) {
9667
+ const obj = {};
9668
+ if (message.relayer !== "") {
9669
+ obj.relayer = message.relayer;
9670
+ }
9671
+ if (message.account !== "") {
9672
+ obj.account = message.account;
9673
+ }
9674
+ if (message.scheme !== "") {
9675
+ obj.scheme = message.scheme;
9676
+ }
9677
+ if (message.pubkey.length !== 0) {
9678
+ obj.pubkey = base64FromBytes6(message.pubkey);
9679
+ }
9680
+ if (message.signature.length !== 0) {
9681
+ obj.signature = base64FromBytes6(message.signature);
9682
+ }
9683
+ if (message.to !== "") {
9684
+ obj.to = message.to;
9685
+ }
9686
+ if (message.amount?.length) {
9687
+ obj.amount = message.amount.map((e) => Coin.toJSON(e));
9688
+ }
9689
+ if (message.nonce !== "0") {
9690
+ obj.nonce = message.nonce;
9691
+ }
9692
+ return obj;
9693
+ },
9694
+ create(base) {
9695
+ return MsgExecuteCosmos.fromPartial(base ?? {});
9696
+ },
9697
+ fromPartial(object) {
9698
+ const message = createBaseMsgExecuteCosmos();
9699
+ message.relayer = object.relayer ?? "";
9700
+ message.account = object.account ?? "";
9701
+ message.scheme = object.scheme ?? "";
9702
+ message.pubkey = object.pubkey ?? new Uint8Array(0);
9703
+ message.signature = object.signature ?? new Uint8Array(0);
9704
+ message.to = object.to ?? "";
9705
+ message.amount = object.amount?.map((e) => Coin.fromPartial(e)) || [];
9706
+ message.nonce = object.nonce ?? "0";
9707
+ return message;
9708
+ }
9709
+ };
9710
+ function createBaseMsgExecuteCosmosResponse() {
9711
+ return { success: false };
9712
+ }
9713
+ var MsgExecuteCosmosResponse = {
9714
+ encode(message, writer = new wire.BinaryWriter()) {
9715
+ if (message.success !== false) {
9716
+ writer.uint32(8).bool(message.success);
9717
+ }
9718
+ return writer;
9719
+ },
9720
+ decode(input, length) {
9721
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
9722
+ const end = length === void 0 ? reader.len : reader.pos + length;
9723
+ const message = createBaseMsgExecuteCosmosResponse();
9724
+ while (reader.pos < end) {
9725
+ const tag = reader.uint32();
9726
+ switch (tag >>> 3) {
9727
+ case 1: {
9728
+ if (tag !== 8) {
9729
+ break;
9730
+ }
9731
+ message.success = reader.bool();
9732
+ continue;
9733
+ }
9734
+ }
9735
+ if ((tag & 7) === 4 || tag === 0) {
9736
+ break;
9737
+ }
9738
+ reader.skip(tag & 7);
9739
+ }
9740
+ return message;
9741
+ },
9742
+ fromJSON(object) {
9743
+ return { success: isSet10(object.success) ? globalThis.Boolean(object.success) : false };
9744
+ },
9745
+ toJSON(message) {
9746
+ const obj = {};
9747
+ if (message.success !== false) {
9748
+ obj.success = message.success;
9749
+ }
9750
+ return obj;
9751
+ },
9752
+ create(base) {
9753
+ return MsgExecuteCosmosResponse.fromPartial(base ?? {});
9754
+ },
9755
+ fromPartial(object) {
9756
+ const message = createBaseMsgExecuteCosmosResponse();
9757
+ message.success = object.success ?? false;
9758
+ return message;
9759
+ }
9760
+ };
9761
+ var MsgDefinition9 = {
9762
+ name: "Msg",
9763
+ fullName: "qorechain.abstractaccount.v1.Msg",
9764
+ methods: {
9765
+ createAbstractAccount: {
9766
+ name: "CreateAbstractAccount",
9767
+ requestType: MsgCreateAbstractAccount,
9768
+ requestStream: false,
9769
+ responseType: MsgCreateAbstractAccountResponse,
9770
+ responseStream: false,
9771
+ options: {}
9772
+ },
9773
+ updateSpendingRules: {
9774
+ name: "UpdateSpendingRules",
9775
+ requestType: MsgUpdateSpendingRules,
9776
+ requestStream: false,
9777
+ responseType: MsgUpdateSpendingRulesResponse,
9778
+ responseStream: false,
9779
+ options: {}
9780
+ },
9781
+ registerAuthenticator: {
9782
+ name: "RegisterAuthenticator",
9783
+ requestType: MsgRegisterAuthenticator,
9784
+ requestStream: false,
9785
+ responseType: MsgRegisterAuthenticatorResponse,
9786
+ responseStream: false,
9787
+ options: {}
9788
+ },
9789
+ revokeAuthenticator: {
9790
+ name: "RevokeAuthenticator",
9791
+ requestType: MsgRevokeAuthenticator,
9792
+ requestStream: false,
9793
+ responseType: MsgRevokeAuthenticatorResponse,
9794
+ responseStream: false,
9795
+ options: {}
9796
+ },
9797
+ executeEVM: {
9798
+ name: "ExecuteEVM",
9799
+ requestType: MsgExecuteEVM,
9800
+ requestStream: false,
9801
+ responseType: MsgExecuteEVMResponse,
9802
+ responseStream: false,
9803
+ options: {}
9804
+ },
9805
+ executeCosmos: {
9806
+ name: "ExecuteCosmos",
9807
+ requestType: MsgExecuteCosmos,
9808
+ requestStream: false,
9809
+ responseType: MsgExecuteCosmosResponse,
9810
+ responseStream: false,
9811
+ options: {}
9812
+ }
9813
+ }
9814
+ };
9815
+ function bytesFromBase646(b64) {
9816
+ if (globalThis.Buffer) {
9817
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
9818
+ } else {
9819
+ const bin = globalThis.atob(b64);
9820
+ const arr = new Uint8Array(bin.length);
9821
+ for (let i = 0; i < bin.length; ++i) {
9822
+ arr[i] = bin.charCodeAt(i);
9823
+ }
9824
+ return arr;
9825
+ }
9826
+ }
9827
+ function base64FromBytes6(arr) {
9828
+ if (globalThis.Buffer) {
9829
+ return globalThis.Buffer.from(arr).toString("base64");
9830
+ } else {
9831
+ const bin = [];
9832
+ arr.forEach((byte) => {
9833
+ bin.push(globalThis.String.fromCharCode(byte));
9834
+ });
9835
+ return globalThis.btoa(bin.join(""));
9836
+ }
9837
+ }
9838
+ function isSet10(value) {
9839
+ return value !== null && value !== void 0;
9840
+ }
9841
+
9842
+ // src/codegen/qorechain/crossvm/v1/tx.ts
9843
+ var tx_exports10 = {};
9844
+ __export(tx_exports10, {
9845
+ MsgCrossVMCall: () => MsgCrossVMCall,
9846
+ MsgCrossVMCallResponse: () => MsgCrossVMCallResponse,
9847
+ MsgDefinition: () => MsgDefinition10,
9848
+ MsgProcessQueue: () => MsgProcessQueue,
9849
+ MsgProcessQueueResponse: () => MsgProcessQueueResponse,
9850
+ protobufPackage: () => protobufPackage10
9851
+ });
9852
+ var protobufPackage10 = "qorechain.crossvm.v1";
9853
+ function createBaseMsgCrossVMCall() {
9854
+ return { sender: "", sourceVm: "", targetVm: "", targetContract: "", payload: new Uint8Array(0), funds: [] };
9855
+ }
9856
+ var MsgCrossVMCall = {
9857
+ encode(message, writer = new wire.BinaryWriter()) {
9858
+ if (message.sender !== "") {
9859
+ writer.uint32(10).string(message.sender);
9860
+ }
9861
+ if (message.sourceVm !== "") {
9862
+ writer.uint32(18).string(message.sourceVm);
9863
+ }
9864
+ if (message.targetVm !== "") {
9865
+ writer.uint32(26).string(message.targetVm);
9132
9866
  }
9133
9867
  if (message.targetContract !== "") {
9134
9868
  writer.uint32(34).string(message.targetContract);
@@ -10003,6 +10737,7 @@ var qorechainRegistryTypes = [
10003
10737
  ["/qorechain.pqc.v1.MsgRegisterPQCKey", MsgRegisterPQCKey],
10004
10738
  ["/qorechain.pqc.v1.MsgRegisterPQCKeyV2", MsgRegisterPQCKeyV2],
10005
10739
  ["/qorechain.pqc.v1.MsgMigratePQCKey", MsgMigratePQCKey],
10740
+ ["/qorechain.pqc.v1.MsgRotatePQCKey", MsgRotatePQCKey],
10006
10741
  ["/qorechain.pqc.v1.MsgDeprecateAlgorithm", MsgDeprecateAlgorithm],
10007
10742
  ["/qorechain.pqc.v1.MsgDisableAlgorithm", MsgDisableAlgorithm],
10008
10743
  // svm
@@ -10043,6 +10778,11 @@ var qorechainRegistryTypes = [
10043
10778
  "/qorechain.abstractaccount.v1.MsgRevokeAuthenticator",
10044
10779
  MsgRevokeAuthenticator
10045
10780
  ],
10781
+ ["/qorechain.abstractaccount.v1.MsgExecuteEVM", MsgExecuteEVM],
10782
+ [
10783
+ "/qorechain.abstractaccount.v1.MsgExecuteCosmos",
10784
+ MsgExecuteCosmos
10785
+ ],
10046
10786
  // crossvm
10047
10787
  ["/qorechain.crossvm.v1.MsgCrossVMCall", MsgCrossVMCall],
10048
10788
  ["/qorechain.crossvm.v1.MsgProcessQueue", MsgProcessQueue],
@@ -10091,6 +10831,34 @@ var SDK_CODES = {
10091
10831
  25: { kind: "invalid_gas_limit", message: "invalid gas limit" },
10092
10832
  30: { kind: "tx_timeout_height", message: "transaction timeout height exceeded" }
10093
10833
  };
10834
+ var ABSTRACTACCOUNT_CODES = {
10835
+ 5: {
10836
+ kind: "spending_limit_exceeded",
10837
+ message: "spending limit exceeded \u2014 the amount is over the authenticator's per-tx or daily SpendingRule"
10838
+ },
10839
+ 6: {
10840
+ kind: "session_key_expired",
10841
+ message: "session key expired \u2014 the authenticator's expiry_unix has passed; re-register the key"
10842
+ },
10843
+ 10: {
10844
+ kind: "permission_denied",
10845
+ message: "permission denied \u2014 the authenticator lacks the permission this message requires (check the permission_schema)"
10846
+ },
10847
+ 11: {
10848
+ kind: "authenticator_replay",
10849
+ message: "authenticator replay \u2014 the nonce does not match the account's expected value; refetch the current nonce/sequence and re-sign"
10850
+ }
10851
+ };
10852
+ var PQC_CODES = {
10853
+ 21: {
10854
+ kind: "hybrid_verify_failed",
10855
+ message: "hybrid signature verification failed \u2014 the ML-DSA-87 signature did not verify (ensure deterministic signing; hedged signatures are rejected)"
10856
+ }
10857
+ };
10858
+ var MODULE_CODES = {
10859
+ abstractaccount: ABSTRACTACCOUNT_CODES,
10860
+ pqc: PQC_CODES
10861
+ };
10094
10862
  var DEFAULT_CODESPACE = "sdk";
10095
10863
  function decodeTxError(input) {
10096
10864
  const codespace = input.codespace || DEFAULT_CODESPACE;
@@ -10106,6 +10874,17 @@ function decodeTxError(input) {
10106
10874
  rawLog
10107
10875
  };
10108
10876
  }
10877
+ } else {
10878
+ const known = MODULE_CODES[codespace]?.[input.code];
10879
+ if (known) {
10880
+ return {
10881
+ code: input.code,
10882
+ codespace,
10883
+ kind: known.kind,
10884
+ message: rawLog ? `${known.message} (${rawLog})` : known.message,
10885
+ rawLog
10886
+ };
10887
+ }
10109
10888
  }
10110
10889
  const detail = rawLog && rawLog.length > 0 ? rawLog : "(no log provided)";
10111
10890
  return {
@@ -11341,6 +12120,82 @@ async function withRetry2(fn, opts = {}) {
11341
12120
  throw lastError;
11342
12121
  }
11343
12122
 
12123
+ // src/tx/authenticator.ts
12124
+ var enc = new TextEncoder();
12125
+ var EVM_AUTH_DOMAIN = "qorechain-evm-auth-v1";
12126
+ var COSMOS_AUTH_DOMAIN = "qorechain-cosmos-auth-v1";
12127
+ var ROTATE_DOMAIN = "qorechain-pqc-rotate-v1";
12128
+ function be64(n) {
12129
+ const b = new Uint8Array(8);
12130
+ let v = BigInt(n);
12131
+ if (v < 0n) throw new Error(`be64: value must be non-negative, got ${n}`);
12132
+ for (let i = 7; i >= 0; i--) {
12133
+ b[i] = Number(v & 0xffn);
12134
+ v >>= 8n;
12135
+ }
12136
+ return b;
12137
+ }
12138
+ function concat(parts) {
12139
+ let len = 0;
12140
+ for (const p of parts) len += p.length;
12141
+ const out = new Uint8Array(len);
12142
+ let o = 0;
12143
+ for (const p of parts) {
12144
+ out.set(p, o);
12145
+ o += p.length;
12146
+ }
12147
+ return out;
12148
+ }
12149
+ function lengthPrefixed(bytes) {
12150
+ return concat([be64(bytes.length), bytes]);
12151
+ }
12152
+ function toBytes2(x) {
12153
+ return typeof x === "string" ? enc.encode(x) : x;
12154
+ }
12155
+ function toHexLower(bytes) {
12156
+ let s = "";
12157
+ for (const b of bytes) s += b.toString(16).padStart(2, "0");
12158
+ return s;
12159
+ }
12160
+ function evmAuthSignBytes(input) {
12161
+ const {
12162
+ chainId,
12163
+ account,
12164
+ pubkey,
12165
+ to = "",
12166
+ value = "0",
12167
+ data = new Uint8Array(0),
12168
+ nonce
12169
+ } = input;
12170
+ const body = concat([
12171
+ enc.encode(EVM_AUTH_DOMAIN),
12172
+ lengthPrefixed(toBytes2(chainId)),
12173
+ lengthPrefixed(toBytes2(account)),
12174
+ lengthPrefixed(pubkey),
12175
+ lengthPrefixed(toBytes2(to)),
12176
+ lengthPrefixed(toBytes2(value)),
12177
+ lengthPrefixed(data),
12178
+ be64(nonce)
12179
+ ]);
12180
+ return sha256(body);
12181
+ }
12182
+ function cosmosAuthSignBytes(input) {
12183
+ const { chainId, account, pubkey, to, amount, nonce } = input;
12184
+ const body = concat([
12185
+ enc.encode(COSMOS_AUTH_DOMAIN),
12186
+ lengthPrefixed(toBytes2(chainId)),
12187
+ lengthPrefixed(toBytes2(account)),
12188
+ lengthPrefixed(pubkey),
12189
+ lengthPrefixed(toBytes2(to)),
12190
+ lengthPrefixed(toBytes2(amount)),
12191
+ be64(nonce)
12192
+ ]);
12193
+ return sha256(body);
12194
+ }
12195
+ function rotationSignBytes(chainId, algorithmId, account, oldPub, newPub) {
12196
+ return `${ROTATE_DOMAIN}|${chainId}|${algorithmId}|${account}|${toHexLower(oldPub)}|${toHexLower(newPub)}`;
12197
+ }
12198
+
11344
12199
  // src/codegen/qorechain/pqc/v1/hybrid.ts
11345
12200
  var hybrid_exports = {};
11346
12201
  __export(hybrid_exports, {
@@ -11640,9 +12495,9 @@ function concatBytes2(...parts) {
11640
12495
  return out;
11641
12496
  }
11642
12497
  function encodeMessages(params) {
11643
- const enc = params.encodeMessage;
12498
+ const enc3 = params.encodeMessage;
11644
12499
  return params.messages.map((m) => {
11645
- if (enc) return enc(m);
12500
+ if (enc3) return enc3(m);
11646
12501
  if (m.value instanceof Uint8Array) {
11647
12502
  return any.Any.fromPartial({ typeUrl: m.typeUrl, value: m.value });
11648
12503
  }
@@ -12069,6 +12924,17 @@ var pqc = {
12069
12924
  disableAlgorithm: composer2(
12070
12925
  "/qorechain.pqc.v1.MsgDisableAlgorithm",
12071
12926
  MsgDisableAlgorithm
12927
+ ),
12928
+ /**
12929
+ * Replace an account's PQC key with a NEW key of the SAME algorithm (rotate a
12930
+ * compromised key, or migrate a legacy-derived key to the canonical
12931
+ * derivation). Dual-signed over the domain-separated rotation bytes (the old
12932
+ * key proves ownership, the new key proves control). Sender-signed; broadcast
12933
+ * BY the account, cosigned (hybrid) with the OLD key.
12934
+ */
12935
+ rotatePqcKey: composer2(
12936
+ "/qorechain.pqc.v1.MsgRotatePQCKey",
12937
+ MsgRotatePQCKey
12072
12938
  )
12073
12939
  };
12074
12940
  var svm = {
@@ -12147,6 +13013,26 @@ var abstractaccount = {
12147
13013
  revokeAuthenticator: composer2(
12148
13014
  "/qorechain.abstractaccount.v1.MsgRevokeAuthenticator",
12149
13015
  MsgRevokeAuthenticator
13016
+ ),
13017
+ /**
13018
+ * EVM-lane spend: execute an EVM call/transfer FROM the canonical account's
13019
+ * 0x address, authorized by a linked authenticator's signature over the EVM
13020
+ * auth sign-bytes. Relayer-signed (it submits + pays fees). See
13021
+ * {@link ../tx/authenticator.evmAuthSignBytes}.
13022
+ */
13023
+ executeEvm: composer2(
13024
+ "/qorechain.abstractaccount.v1.MsgExecuteEVM",
13025
+ MsgExecuteEVM
13026
+ ),
13027
+ /**
13028
+ * Native-lane spend: move native QOR FROM the canonical account via x/bank,
13029
+ * authorized by a linked authenticator's signature over the Cosmos auth
13030
+ * sign-bytes. Relayer-signed (it submits + pays fees). See
13031
+ * {@link ../tx/authenticator.cosmosAuthSignBytes}.
13032
+ */
13033
+ executeCosmos: composer2(
13034
+ "/qorechain.abstractaccount.v1.MsgExecuteCosmos",
13035
+ MsgExecuteCosmos
12150
13036
  )
12151
13037
  };
12152
13038
  var crossvm = {
@@ -12244,6 +13130,9 @@ __export(query_exports, {
12244
13130
  QueryConfigRequest: () => QueryConfigRequest,
12245
13131
  QueryConfigResponse: () => QueryConfigResponse,
12246
13132
  QueryDefinition: () => QueryDefinition,
13133
+ QueryPermissionSchemaRequest: () => QueryPermissionSchemaRequest,
13134
+ QueryPermissionSchemaResponse: () => QueryPermissionSchemaResponse,
13135
+ QueryPermissionSchemaResponse_MsgPermissionsEntry: () => QueryPermissionSchemaResponse_MsgPermissionsEntry,
12247
13136
  protobufPackage: () => protobufPackage13
12248
13137
  });
12249
13138
  var protobufPackage13 = "qorechain.abstractaccount.v1";
@@ -12772,6 +13661,236 @@ var QueryAccountsResponse = {
12772
13661
  return message;
12773
13662
  }
12774
13663
  };
13664
+ function createBaseQueryPermissionSchemaRequest() {
13665
+ return {};
13666
+ }
13667
+ var QueryPermissionSchemaRequest = {
13668
+ encode(_, writer = new wire.BinaryWriter()) {
13669
+ return writer;
13670
+ },
13671
+ decode(input, length) {
13672
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
13673
+ const end = length === void 0 ? reader.len : reader.pos + length;
13674
+ const message = createBaseQueryPermissionSchemaRequest();
13675
+ while (reader.pos < end) {
13676
+ const tag = reader.uint32();
13677
+ if ((tag & 7) === 4 || tag === 0) {
13678
+ break;
13679
+ }
13680
+ reader.skip(tag & 7);
13681
+ }
13682
+ return message;
13683
+ },
13684
+ fromJSON(_) {
13685
+ return {};
13686
+ },
13687
+ toJSON(_) {
13688
+ const obj = {};
13689
+ return obj;
13690
+ },
13691
+ create(base) {
13692
+ return QueryPermissionSchemaRequest.fromPartial(base ?? {});
13693
+ },
13694
+ fromPartial(_) {
13695
+ const message = createBaseQueryPermissionSchemaRequest();
13696
+ return message;
13697
+ }
13698
+ };
13699
+ function createBaseQueryPermissionSchemaResponse() {
13700
+ return { schemaVersion: "", permissions: [], msgPermissions: {}, keyManagementMsgs: [] };
13701
+ }
13702
+ var QueryPermissionSchemaResponse = {
13703
+ encode(message, writer = new wire.BinaryWriter()) {
13704
+ if (message.schemaVersion !== "") {
13705
+ writer.uint32(10).string(message.schemaVersion);
13706
+ }
13707
+ for (const v of message.permissions) {
13708
+ writer.uint32(18).string(v);
13709
+ }
13710
+ globalThis.Object.entries(message.msgPermissions).forEach(([key, value]) => {
13711
+ QueryPermissionSchemaResponse_MsgPermissionsEntry.encode({ key, value }, writer.uint32(26).fork()).join();
13712
+ });
13713
+ for (const v of message.keyManagementMsgs) {
13714
+ writer.uint32(34).string(v);
13715
+ }
13716
+ return writer;
13717
+ },
13718
+ decode(input, length) {
13719
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
13720
+ const end = length === void 0 ? reader.len : reader.pos + length;
13721
+ const message = createBaseQueryPermissionSchemaResponse();
13722
+ while (reader.pos < end) {
13723
+ const tag = reader.uint32();
13724
+ switch (tag >>> 3) {
13725
+ case 1: {
13726
+ if (tag !== 10) {
13727
+ break;
13728
+ }
13729
+ message.schemaVersion = reader.string();
13730
+ continue;
13731
+ }
13732
+ case 2: {
13733
+ if (tag !== 18) {
13734
+ break;
13735
+ }
13736
+ message.permissions.push(reader.string());
13737
+ continue;
13738
+ }
13739
+ case 3: {
13740
+ if (tag !== 26) {
13741
+ break;
13742
+ }
13743
+ const entry3 = QueryPermissionSchemaResponse_MsgPermissionsEntry.decode(reader, reader.uint32());
13744
+ if (entry3.value !== void 0) {
13745
+ message.msgPermissions[entry3.key] = entry3.value;
13746
+ }
13747
+ continue;
13748
+ }
13749
+ case 4: {
13750
+ if (tag !== 34) {
13751
+ break;
13752
+ }
13753
+ message.keyManagementMsgs.push(reader.string());
13754
+ continue;
13755
+ }
13756
+ }
13757
+ if ((tag & 7) === 4 || tag === 0) {
13758
+ break;
13759
+ }
13760
+ reader.skip(tag & 7);
13761
+ }
13762
+ return message;
13763
+ },
13764
+ fromJSON(object) {
13765
+ return {
13766
+ schemaVersion: isSet14(object.schemaVersion) ? globalThis.String(object.schemaVersion) : isSet14(object.schema_version) ? globalThis.String(object.schema_version) : "",
13767
+ permissions: globalThis.Array.isArray(object?.permissions) ? object.permissions.map((e) => globalThis.String(e)) : [],
13768
+ msgPermissions: isObject(object.msgPermissions) ? globalThis.Object.entries(object.msgPermissions).reduce(
13769
+ (acc, [key, value]) => {
13770
+ acc[key] = globalThis.String(value);
13771
+ return acc;
13772
+ },
13773
+ {}
13774
+ ) : isObject(object.msg_permissions) ? globalThis.Object.entries(object.msg_permissions).reduce(
13775
+ (acc, [key, value]) => {
13776
+ acc[key] = globalThis.String(value);
13777
+ return acc;
13778
+ },
13779
+ {}
13780
+ ) : {},
13781
+ 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)) : []
13782
+ };
13783
+ },
13784
+ toJSON(message) {
13785
+ const obj = {};
13786
+ if (message.schemaVersion !== "") {
13787
+ obj.schemaVersion = message.schemaVersion;
13788
+ }
13789
+ if (message.permissions?.length) {
13790
+ obj.permissions = message.permissions;
13791
+ }
13792
+ if (message.msgPermissions) {
13793
+ const entries = globalThis.Object.entries(message.msgPermissions);
13794
+ if (entries.length > 0) {
13795
+ obj.msgPermissions = {};
13796
+ entries.forEach(([k, v]) => {
13797
+ obj.msgPermissions[k] = v;
13798
+ });
13799
+ }
13800
+ }
13801
+ if (message.keyManagementMsgs?.length) {
13802
+ obj.keyManagementMsgs = message.keyManagementMsgs;
13803
+ }
13804
+ return obj;
13805
+ },
13806
+ create(base) {
13807
+ return QueryPermissionSchemaResponse.fromPartial(base ?? {});
13808
+ },
13809
+ fromPartial(object) {
13810
+ const message = createBaseQueryPermissionSchemaResponse();
13811
+ message.schemaVersion = object.schemaVersion ?? "";
13812
+ message.permissions = object.permissions?.map((e) => e) || [];
13813
+ message.msgPermissions = globalThis.Object.entries(object.msgPermissions ?? {}).reduce(
13814
+ (acc, [key, value]) => {
13815
+ if (value !== void 0) {
13816
+ acc[key] = globalThis.String(value);
13817
+ }
13818
+ return acc;
13819
+ },
13820
+ {}
13821
+ );
13822
+ message.keyManagementMsgs = object.keyManagementMsgs?.map((e) => e) || [];
13823
+ return message;
13824
+ }
13825
+ };
13826
+ function createBaseQueryPermissionSchemaResponse_MsgPermissionsEntry() {
13827
+ return { key: "", value: "" };
13828
+ }
13829
+ var QueryPermissionSchemaResponse_MsgPermissionsEntry = {
13830
+ encode(message, writer = new wire.BinaryWriter()) {
13831
+ if (message.key !== "") {
13832
+ writer.uint32(10).string(message.key);
13833
+ }
13834
+ if (message.value !== "") {
13835
+ writer.uint32(18).string(message.value);
13836
+ }
13837
+ return writer;
13838
+ },
13839
+ decode(input, length) {
13840
+ const reader = input instanceof wire.BinaryReader ? input : new wire.BinaryReader(input);
13841
+ const end = length === void 0 ? reader.len : reader.pos + length;
13842
+ const message = createBaseQueryPermissionSchemaResponse_MsgPermissionsEntry();
13843
+ while (reader.pos < end) {
13844
+ const tag = reader.uint32();
13845
+ switch (tag >>> 3) {
13846
+ case 1: {
13847
+ if (tag !== 10) {
13848
+ break;
13849
+ }
13850
+ message.key = reader.string();
13851
+ continue;
13852
+ }
13853
+ case 2: {
13854
+ if (tag !== 18) {
13855
+ break;
13856
+ }
13857
+ message.value = reader.string();
13858
+ continue;
13859
+ }
13860
+ }
13861
+ if ((tag & 7) === 4 || tag === 0) {
13862
+ break;
13863
+ }
13864
+ reader.skip(tag & 7);
13865
+ }
13866
+ return message;
13867
+ },
13868
+ fromJSON(object) {
13869
+ return {
13870
+ key: isSet14(object.key) ? globalThis.String(object.key) : "",
13871
+ value: isSet14(object.value) ? globalThis.String(object.value) : ""
13872
+ };
13873
+ },
13874
+ toJSON(message) {
13875
+ const obj = {};
13876
+ if (message.key !== "") {
13877
+ obj.key = message.key;
13878
+ }
13879
+ if (message.value !== "") {
13880
+ obj.value = message.value;
13881
+ }
13882
+ return obj;
13883
+ },
13884
+ create(base) {
13885
+ return QueryPermissionSchemaResponse_MsgPermissionsEntry.fromPartial(base ?? {});
13886
+ },
13887
+ fromPartial(object) {
13888
+ const message = createBaseQueryPermissionSchemaResponse_MsgPermissionsEntry();
13889
+ message.key = object.key ?? "";
13890
+ message.value = object.value ?? "";
13891
+ return message;
13892
+ }
13893
+ };
12775
13894
  var QueryDefinition = {
12776
13895
  name: "Query",
12777
13896
  fullName: "qorechain.abstractaccount.v1.Query",
@@ -12783,7 +13902,53 @@ var QueryDefinition = {
12783
13902
  requestStream: false,
12784
13903
  responseType: QueryConfigResponse,
12785
13904
  responseStream: false,
12786
- options: {}
13905
+ options: {
13906
+ _unknownFields: {
13907
+ 578365826: [
13908
+ new Uint8Array([
13909
+ 38,
13910
+ 18,
13911
+ 36,
13912
+ 47,
13913
+ 113,
13914
+ 111,
13915
+ 114,
13916
+ 101,
13917
+ 99,
13918
+ 104,
13919
+ 97,
13920
+ 105,
13921
+ 110,
13922
+ 47,
13923
+ 97,
13924
+ 98,
13925
+ 115,
13926
+ 116,
13927
+ 114,
13928
+ 97,
13929
+ 99,
13930
+ 116,
13931
+ 97,
13932
+ 99,
13933
+ 99,
13934
+ 111,
13935
+ 117,
13936
+ 110,
13937
+ 116,
13938
+ 47,
13939
+ 118,
13940
+ 49,
13941
+ 47,
13942
+ 99,
13943
+ 111,
13944
+ 110,
13945
+ 102,
13946
+ 105,
13947
+ 103
13948
+ ])
13949
+ ]
13950
+ }
13951
+ }
12787
13952
  },
12788
13953
  /** Account returns a single abstract account by address. */
12789
13954
  account: {
@@ -12792,7 +13957,65 @@ var QueryDefinition = {
12792
13957
  requestStream: false,
12793
13958
  responseType: QueryAccountResponse,
12794
13959
  responseStream: false,
12795
- options: {}
13960
+ options: {
13961
+ _unknownFields: {
13962
+ 578365826: [
13963
+ new Uint8Array([
13964
+ 50,
13965
+ 18,
13966
+ 48,
13967
+ 47,
13968
+ 113,
13969
+ 111,
13970
+ 114,
13971
+ 101,
13972
+ 99,
13973
+ 104,
13974
+ 97,
13975
+ 105,
13976
+ 110,
13977
+ 47,
13978
+ 97,
13979
+ 98,
13980
+ 115,
13981
+ 116,
13982
+ 114,
13983
+ 97,
13984
+ 99,
13985
+ 116,
13986
+ 97,
13987
+ 99,
13988
+ 99,
13989
+ 111,
13990
+ 117,
13991
+ 110,
13992
+ 116,
13993
+ 47,
13994
+ 118,
13995
+ 49,
13996
+ 47,
13997
+ 97,
13998
+ 99,
13999
+ 99,
14000
+ 111,
14001
+ 117,
14002
+ 110,
14003
+ 116,
14004
+ 115,
14005
+ 47,
14006
+ 123,
14007
+ 97,
14008
+ 100,
14009
+ 100,
14010
+ 114,
14011
+ 101,
14012
+ 115,
14013
+ 115,
14014
+ 125
14015
+ ])
14016
+ ]
14017
+ }
14018
+ }
12796
14019
  },
12797
14020
  /** Accounts lists all abstract accounts. */
12798
14021
  accounts: {
@@ -12801,10 +14024,131 @@ var QueryDefinition = {
12801
14024
  requestStream: false,
12802
14025
  responseType: QueryAccountsResponse,
12803
14026
  responseStream: false,
12804
- options: {}
14027
+ options: {
14028
+ _unknownFields: {
14029
+ 578365826: [
14030
+ new Uint8Array([
14031
+ 40,
14032
+ 18,
14033
+ 38,
14034
+ 47,
14035
+ 113,
14036
+ 111,
14037
+ 114,
14038
+ 101,
14039
+ 99,
14040
+ 104,
14041
+ 97,
14042
+ 105,
14043
+ 110,
14044
+ 47,
14045
+ 97,
14046
+ 98,
14047
+ 115,
14048
+ 116,
14049
+ 114,
14050
+ 97,
14051
+ 99,
14052
+ 116,
14053
+ 97,
14054
+ 99,
14055
+ 99,
14056
+ 111,
14057
+ 117,
14058
+ 110,
14059
+ 116,
14060
+ 47,
14061
+ 118,
14062
+ 49,
14063
+ 47,
14064
+ 97,
14065
+ 99,
14066
+ 99,
14067
+ 111,
14068
+ 117,
14069
+ 110,
14070
+ 116,
14071
+ 115
14072
+ ])
14073
+ ]
14074
+ }
14075
+ }
14076
+ },
14077
+ /**
14078
+ * PermissionSchema returns the canonical authenticator permission taxonomy so
14079
+ * clients (QoreX/dashboard/relayer) validate scopes without hardcoding strings
14080
+ * and detect drift via schema_version (v3.1.85).
14081
+ */
14082
+ permissionSchema: {
14083
+ name: "PermissionSchema",
14084
+ requestType: QueryPermissionSchemaRequest,
14085
+ requestStream: false,
14086
+ responseType: QueryPermissionSchemaResponse,
14087
+ responseStream: false,
14088
+ options: {
14089
+ _unknownFields: {
14090
+ 578365826: [
14091
+ new Uint8Array([
14092
+ 49,
14093
+ 18,
14094
+ 47,
14095
+ 47,
14096
+ 113,
14097
+ 111,
14098
+ 114,
14099
+ 101,
14100
+ 99,
14101
+ 104,
14102
+ 97,
14103
+ 105,
14104
+ 110,
14105
+ 47,
14106
+ 97,
14107
+ 98,
14108
+ 115,
14109
+ 116,
14110
+ 114,
14111
+ 97,
14112
+ 99,
14113
+ 116,
14114
+ 97,
14115
+ 99,
14116
+ 99,
14117
+ 111,
14118
+ 117,
14119
+ 110,
14120
+ 116,
14121
+ 47,
14122
+ 118,
14123
+ 49,
14124
+ 47,
14125
+ 112,
14126
+ 101,
14127
+ 114,
14128
+ 109,
14129
+ 105,
14130
+ 115,
14131
+ 115,
14132
+ 105,
14133
+ 111,
14134
+ 110,
14135
+ 95,
14136
+ 115,
14137
+ 99,
14138
+ 104,
14139
+ 101,
14140
+ 109,
14141
+ 97
14142
+ ])
14143
+ ]
14144
+ }
14145
+ }
12805
14146
  }
12806
14147
  }
12807
14148
  };
14149
+ function isObject(value) {
14150
+ return typeof value === "object" && value !== null;
14151
+ }
12808
14152
  function isSet14(value) {
12809
14153
  return value !== null && value !== void 0;
12810
14154
  }
@@ -24019,6 +25363,277 @@ function base64FromBytes11(arr) {
24019
25363
  function isSet26(value) {
24020
25364
  return value !== null && value !== void 0;
24021
25365
  }
25366
+ var enc2 = new TextEncoder();
25367
+ function toBytes3(x) {
25368
+ return typeof x === "string" ? enc2.encode(x) : x;
25369
+ }
25370
+ function hexToBytes3(hex) {
25371
+ const h = hex.replace(/^0x/, "");
25372
+ const out = new Uint8Array(h.length / 2);
25373
+ for (let i = 0; i < out.length; i++) {
25374
+ out[i] = parseInt(h.slice(i * 2, i * 2 + 2), 16);
25375
+ }
25376
+ return out;
25377
+ }
25378
+ function bytesToHex0x(b) {
25379
+ let s = "0x";
25380
+ for (const x of b) s += x.toString(16).padStart(2, "0");
25381
+ return s;
25382
+ }
25383
+ function toHexLower2(b) {
25384
+ let s = "";
25385
+ for (const x of b) s += x.toString(16).padStart(2, "0");
25386
+ return s;
25387
+ }
25388
+ function parseCoins(amount) {
25389
+ const m = /^([0-9]+)([a-zA-Z][a-zA-Z0-9/:._-]*)$/.exec(String(amount).trim());
25390
+ if (!m) {
25391
+ throw new Error(`invalid amount "${amount}" (expected e.g. "100uqor")`);
25392
+ }
25393
+ return [{ denom: m[2], amount: m[1] }];
25394
+ }
25395
+ function executeEvmMsg(input) {
25396
+ const {
25397
+ relayer,
25398
+ account,
25399
+ scheme,
25400
+ pubkey,
25401
+ signature,
25402
+ to = "",
25403
+ value = "0",
25404
+ data = new Uint8Array(0),
25405
+ gasLimit,
25406
+ nonce
25407
+ } = input;
25408
+ return {
25409
+ typeUrl: "/qorechain.abstractaccount.v1.MsgExecuteEVM",
25410
+ value: {
25411
+ relayer,
25412
+ account,
25413
+ scheme,
25414
+ pubkey: toBytes3(pubkey),
25415
+ signature: toBytes3(signature),
25416
+ to,
25417
+ value,
25418
+ data: toBytes3(data),
25419
+ gasLimit: BigInt(gasLimit),
25420
+ nonce: BigInt(nonce)
25421
+ }
25422
+ };
25423
+ }
25424
+ function executeCosmosMsg(input) {
25425
+ const { relayer, account, scheme, pubkey, signature, to, amount, nonce } = input;
25426
+ return {
25427
+ typeUrl: "/qorechain.abstractaccount.v1.MsgExecuteCosmos",
25428
+ value: {
25429
+ relayer,
25430
+ account,
25431
+ scheme,
25432
+ pubkey: toBytes3(pubkey),
25433
+ signature: toBytes3(signature),
25434
+ to,
25435
+ amount: parseCoins(amount),
25436
+ nonce: BigInt(nonce)
25437
+ }
25438
+ };
25439
+ }
25440
+ function revokeAuthenticatorMsg(input) {
25441
+ const { owner, account = owner, scheme, pubkey } = input;
25442
+ return {
25443
+ typeUrl: "/qorechain.abstractaccount.v1.MsgRevokeAuthenticator",
25444
+ value: {
25445
+ owner,
25446
+ accountAddress: account,
25447
+ scheme,
25448
+ pubkey: toBytes3(pubkey)
25449
+ }
25450
+ };
25451
+ }
25452
+ function registerEthAuthenticatorMsg(input) {
25453
+ const {
25454
+ owner,
25455
+ account = owner,
25456
+ ethAddress,
25457
+ permissions = ["evm"],
25458
+ expiryUnix,
25459
+ label = "metamask"
25460
+ } = input;
25461
+ return {
25462
+ typeUrl: "/qorechain.abstractaccount.v1.MsgRegisterAuthenticator",
25463
+ value: {
25464
+ owner,
25465
+ accountAddress: account,
25466
+ scheme: "secp256k1",
25467
+ pubkey: hexToBytes3(ethAddress),
25468
+ permissions,
25469
+ expiryUnix: BigInt(expiryUnix),
25470
+ label
25471
+ }
25472
+ };
25473
+ }
25474
+ function rotatePqcKeyMsg(input) {
25475
+ const { sender, oldPublicKey, newPublicKey, oldSignature, newSignature } = input;
25476
+ return {
25477
+ typeUrl: "/qorechain.pqc.v1.MsgRotatePQCKey",
25478
+ value: {
25479
+ sender,
25480
+ oldPublicKey: toBytes3(oldPublicKey),
25481
+ newPublicKey: toBytes3(newPublicKey),
25482
+ oldSignature: toBytes3(oldSignature),
25483
+ newSignature: toBytes3(newSignature)
25484
+ }
25485
+ };
25486
+ }
25487
+ function walletPubkey(wallet) {
25488
+ const pk = wallet.publicKey;
25489
+ return pk instanceof Uint8Array ? pk : pk.toBytes();
25490
+ }
25491
+ function normalizeSignature(res) {
25492
+ return res instanceof Uint8Array ? res : res.signature;
25493
+ }
25494
+ async function buildPhantomExecuteEvm(opts) {
25495
+ const {
25496
+ wallet,
25497
+ relayer,
25498
+ chainId,
25499
+ account,
25500
+ to = "",
25501
+ value = "0",
25502
+ data = new Uint8Array(0),
25503
+ gasLimit = 1e5,
25504
+ nonce
25505
+ } = opts;
25506
+ const pubkey = walletPubkey(wallet);
25507
+ const digest = evmAuthSignBytes({ chainId, account, pubkey, to, value, data, nonce });
25508
+ const signature = normalizeSignature(await wallet.signMessage(digest));
25509
+ return executeEvmMsg({
25510
+ relayer,
25511
+ account,
25512
+ scheme: "ed25519",
25513
+ pubkey,
25514
+ signature,
25515
+ to,
25516
+ value,
25517
+ data,
25518
+ gasLimit,
25519
+ nonce
25520
+ });
25521
+ }
25522
+ async function buildPhantomExecuteCosmos(opts) {
25523
+ const { wallet, relayer, chainId, account, to, amount, nonce } = opts;
25524
+ const pubkey = walletPubkey(wallet);
25525
+ const digest = cosmosAuthSignBytes({ chainId, account, pubkey, to, amount, nonce });
25526
+ const signature = normalizeSignature(await wallet.signMessage(digest));
25527
+ return executeCosmosMsg({
25528
+ relayer,
25529
+ account,
25530
+ scheme: "ed25519",
25531
+ pubkey,
25532
+ signature,
25533
+ to,
25534
+ amount,
25535
+ nonce
25536
+ });
25537
+ }
25538
+ async function ethPersonalSign(provider, address, digest) {
25539
+ const sigHex = await provider.request({
25540
+ method: "personal_sign",
25541
+ params: [bytesToHex0x(digest), address]
25542
+ });
25543
+ return hexToBytes3(sigHex);
25544
+ }
25545
+ async function buildMetaMaskExecuteEvm(opts) {
25546
+ const {
25547
+ provider,
25548
+ address,
25549
+ relayer,
25550
+ chainId,
25551
+ account,
25552
+ to = "",
25553
+ value = "0",
25554
+ data = new Uint8Array(0),
25555
+ gasLimit = 1e5,
25556
+ nonce
25557
+ } = opts;
25558
+ const pubkey = hexToBytes3(address);
25559
+ const digest = evmAuthSignBytes({ chainId, account, pubkey, to, value, data, nonce });
25560
+ const signature = await ethPersonalSign(provider, address, digest);
25561
+ return executeEvmMsg({
25562
+ relayer,
25563
+ account,
25564
+ scheme: "secp256k1",
25565
+ pubkey,
25566
+ signature,
25567
+ to,
25568
+ value,
25569
+ data,
25570
+ gasLimit,
25571
+ nonce
25572
+ });
25573
+ }
25574
+ async function buildMetaMaskExecuteCosmos(opts) {
25575
+ const { provider, address, relayer, chainId, account, to, amount, nonce } = opts;
25576
+ const pubkey = hexToBytes3(address);
25577
+ const digest = cosmosAuthSignBytes({ chainId, account, pubkey, to, amount, nonce });
25578
+ const signature = await ethPersonalSign(provider, address, digest);
25579
+ return executeCosmosMsg({
25580
+ relayer,
25581
+ account,
25582
+ scheme: "secp256k1",
25583
+ pubkey,
25584
+ signature,
25585
+ to,
25586
+ amount,
25587
+ nonce
25588
+ });
25589
+ }
25590
+ var CANONICAL_DERIVATION = "adapter";
25591
+ var LEGACY_DERIVATION = "bridge";
25592
+ function derivePqcLegacy(mnemonic) {
25593
+ return generatePqcKeypair(pqc$1.shake256(enc2.encode(mnemonic), 32));
25594
+ }
25595
+ function derivePqcCanonical(account, mnemonic) {
25596
+ return generatePqcKeypair(
25597
+ pqc$1.shake256(enc2.encode(`qorechain:pqc:v1|${account}|${mnemonic}`), 32)
25598
+ );
25599
+ }
25600
+ function derivePqcByScheme(scheme, account, mnemonic) {
25601
+ if (scheme === LEGACY_DERIVATION || scheme === "mnemonic-only") {
25602
+ return derivePqcLegacy(mnemonic);
25603
+ }
25604
+ if (scheme === CANONICAL_DERIVATION || scheme === "") {
25605
+ return derivePqcCanonical(account, mnemonic);
25606
+ }
25607
+ throw new Error(`unknown derivation "${scheme}" (use adapter|bridge)`);
25608
+ }
25609
+ function rotatePqcKeyMsgFromMnemonic(opts) {
25610
+ const {
25611
+ account,
25612
+ mnemonic,
25613
+ chainId,
25614
+ algorithmId = 1,
25615
+ oldDerivation = LEGACY_DERIVATION,
25616
+ newDerivation = CANONICAL_DERIVATION
25617
+ } = opts;
25618
+ const oldKp = derivePqcByScheme(oldDerivation, account, mnemonic);
25619
+ const newKp = derivePqcByScheme(newDerivation, account, mnemonic);
25620
+ if (toHexLower2(oldKp.publicKey) === toHexLower2(newKp.publicKey)) {
25621
+ throw new Error(
25622
+ "old and new derivations produce the same key \u2014 rotation would be a no-op"
25623
+ );
25624
+ }
25625
+ const sb = enc2.encode(
25626
+ rotationSignBytes(chainId, algorithmId, account, oldKp.publicKey, newKp.publicKey)
25627
+ );
25628
+ const msg2 = rotatePqcKeyMsg({
25629
+ sender: account,
25630
+ oldPublicKey: oldKp.publicKey,
25631
+ newPublicKey: newKp.publicKey,
25632
+ oldSignature: pqc$1.mldsa.sign(oldKp.secretKey, sb),
25633
+ newSignature: pqc$1.mldsa.sign(newKp.secretKey, sb)
25634
+ });
25635
+ return { msg: msg2, oldKeypair: oldKp, newKeypair: newKp };
25636
+ }
24022
25637
 
24023
25638
  // src/wallet/cosmos.ts
24024
25639
  function suggestChainInfo(network) {
@@ -24107,6 +25722,13 @@ function createQueryClients(rpc) {
24107
25722
  "Accounts",
24108
25723
  QueryAccountsRequest,
24109
25724
  QueryAccountsResponse
25725
+ ),
25726
+ permissionSchema: unary(
25727
+ rpc,
25728
+ "qorechain.abstractaccount.v1.Query",
25729
+ "PermissionSchema",
25730
+ QueryPermissionSchemaRequest,
25731
+ QueryPermissionSchemaResponse
24110
25732
  )
24111
25733
  },
24112
25734
  amm: {
@@ -24823,7 +26445,7 @@ async function migrateToHybrid(tx, opts) {
24823
26445
  }
24824
26446
 
24825
26447
  // src/index.ts
24826
- var VERSION = "0.6.1";
26448
+ var VERSION = "0.7.0";
24827
26449
 
24828
26450
  Object.defineProperty(exports, "AI_ANOMALY_CHECK_ADDRESS", {
24829
26451
  enumerable: true,
@@ -24856,6 +26478,7 @@ Object.defineProperty(exports, "simulateWithRiskScore", {
24856
26478
  exports.AlgorithmDilithium5 = AlgorithmDilithium5;
24857
26479
  exports.AlgorithmMLKEM1024 = AlgorithmMLKEM1024;
24858
26480
  exports.AlgorithmUnspecified = AlgorithmUnspecified;
26481
+ exports.CANONICAL_DERIVATION = CANONICAL_DERIVATION;
24859
26482
  exports.DEFAULT_GAS_MULTIPLIER = DEFAULT_GAS_MULTIPLIER;
24860
26483
  exports.DEFAULT_GAS_PRICE = DEFAULT_GAS_PRICE;
24861
26484
  exports.ETHSECP256K1_PUBKEY_TYPE = ETHSECP256K1_PUBKEY_TYPE;
@@ -24865,6 +26488,7 @@ exports.HYBRID_SIG_TYPE_URL = HYBRID_SIG_TYPE_URL;
24865
26488
  exports.HybridSigner = HybridSigner;
24866
26489
  exports.JsonRpcClient = JsonRpcClient;
24867
26490
  exports.JsonRpcError = JsonRpcError;
26491
+ exports.LEGACY_DERIVATION = LEGACY_DERIVATION;
24868
26492
  exports.ML_DSA_87_PUBLIC_KEY_LENGTH = ML_DSA_87_PUBLIC_KEY_LENGTH;
24869
26493
  exports.ML_DSA_87_SECRET_KEY_LENGTH = ML_DSA_87_SECRET_KEY_LENGTH;
24870
26494
  exports.ML_DSA_87_SEED_LENGTH = ML_DSA_87_SEED_LENGTH;
@@ -24890,6 +26514,7 @@ exports.amm = amm;
24890
26514
  exports.attachHybridExtension = attachHybridExtension;
24891
26515
  exports.authz = authz;
24892
26516
  exports.bank = bank;
26517
+ exports.be64 = be64;
24893
26518
  exports.bech32ToHex = bech32ToHex;
24894
26519
  exports.bridge = bridge;
24895
26520
  exports.broadcastAndWait = broadcastAndWait;
@@ -24897,6 +26522,10 @@ exports.buildAminoTypes = buildAminoTypes;
24897
26522
  exports.buildEventsQuery = buildEventsQuery;
24898
26523
  exports.buildHybridSignatureExtension = buildHybridSignatureExtension;
24899
26524
  exports.buildHybridTx = buildHybridTx;
26525
+ exports.buildMetaMaskExecuteCosmos = buildMetaMaskExecuteCosmos;
26526
+ exports.buildMetaMaskExecuteEvm = buildMetaMaskExecuteEvm;
26527
+ exports.buildPhantomExecuteCosmos = buildPhantomExecuteCosmos;
26528
+ exports.buildPhantomExecuteEvm = buildPhantomExecuteEvm;
24900
26529
  exports.buildRegisterPqcKeyMsg = buildRegisterPqcKeyMsg;
24901
26530
  exports.buildTxQuery = buildTxQuery;
24902
26531
  exports.buildUrl = buildUrl;
@@ -24906,6 +26535,7 @@ exports.clearAdmin = clearAdmin;
24906
26535
  exports.connectCosmWasmSigner = connectCosmWasmSigner;
24907
26536
  exports.connectPhantomUnified = connectPhantomUnified;
24908
26537
  exports.connectQueryClients = connectQueryClients;
26538
+ exports.cosmosAuthSignBytes = cosmosAuthSignBytes;
24909
26539
  exports.createClient = createClient;
24910
26540
  exports.createCosmWasmClient = createCosmWasmClient;
24911
26541
  exports.createCrossVMClient = createCrossVMClient;
@@ -24917,6 +26547,7 @@ exports.crossvm = crossvm;
24917
26547
  exports.decodeTxError = decodeTxError;
24918
26548
  exports.deriveEvmAccount = deriveEvmAccount;
24919
26549
  exports.deriveNativeAccount = deriveNativeAccount;
26550
+ exports.derivePqcLegacy = derivePqcLegacy;
24920
26551
  exports.deriveSvmAccount = deriveSvmAccount;
24921
26552
  exports.deriveUnifiedAccount = deriveUnifiedAccount;
24922
26553
  exports.directSignerFromPrivateKey = directSignerFromPrivateKey;
@@ -24924,8 +26555,11 @@ exports.distribution = distribution;
24924
26555
  exports.encodeHybridExtension = encodeHybridExtension;
24925
26556
  exports.ensurePqcRegistered = ensurePqcRegistered;
24926
26557
  exports.estimateFee = estimateFee;
26558
+ exports.evmAuthSignBytes = evmAuthSignBytes;
24927
26559
  exports.evmToQor = evmToQor;
24928
26560
  exports.execute = execute;
26561
+ exports.executeCosmosMsg = executeCosmosMsg;
26562
+ exports.executeEvmMsg = executeEvmMsg;
24929
26563
  exports.explorerAddressUrl = explorerAddressUrl;
24930
26564
  exports.explorerBlockUrl = explorerBlockUrl;
24931
26565
  exports.explorerTxUrl = explorerTxUrl;
@@ -24963,6 +26597,7 @@ exports.isValidSvmAddress = isValidSvmAddress;
24963
26597
  exports.joinUrl = joinUrl;
24964
26598
  exports.keccak256 = keccak256;
24965
26599
  exports.keccak256Hex = keccak256Hex;
26600
+ exports.lengthPrefixed = lengthPrefixed;
24966
26601
  exports.license = license;
24967
26602
  exports.lightnode = lightnode;
24968
26603
  exports.listNetworks = listNetworks;
@@ -24984,10 +26619,15 @@ exports.qorechainRegistryTypes = qorechainRegistryTypes;
24984
26619
  exports.qorechainTypes = codegen_exports;
24985
26620
  exports.queryContractSmart = queryContractSmart;
24986
26621
  exports.rdk = rdk;
26622
+ exports.registerEthAuthenticatorMsg = registerEthAuthenticatorMsg;
24987
26623
  exports.requestFaucet = requestFaucet;
26624
+ exports.revokeAuthenticatorMsg = revokeAuthenticatorMsg;
24988
26625
  exports.ripemd160 = ripemd160;
24989
26626
  exports.ripemd160Hex = ripemd160Hex;
24990
26627
  exports.rlconsensus = rlconsensus;
26628
+ exports.rotatePqcKeyMsg = rotatePqcKeyMsg;
26629
+ exports.rotatePqcKeyMsgFromMnemonic = rotatePqcKeyMsgFromMnemonic;
26630
+ exports.rotationSignBytes = rotationSignBytes;
24991
26631
  exports.searchTxs = searchTxs;
24992
26632
  exports.sha256 = sha256;
24993
26633
  exports.sha256Hex = sha256Hex;