@trustwallet/wallet-core 3.1.11 → 3.1.12

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.
@@ -10402,7 +10402,123 @@ export namespace TW {
10402
10402
  /** TransactionMode enum. */
10403
10403
  enum TransactionMode {
10404
10404
  Legacy = 0,
10405
- Enveloped = 1
10405
+ Enveloped = 1,
10406
+ UserOp = 2
10407
+ }
10408
+
10409
+ /** Properties of a UserOperation. */
10410
+ interface IUserOperation {
10411
+
10412
+ /** UserOperation entryPoint */
10413
+ entryPoint?: (string|null);
10414
+
10415
+ /** UserOperation accountFactory */
10416
+ accountFactory?: (string|null);
10417
+
10418
+ /** UserOperation accountLogic */
10419
+ accountLogic?: (string|null);
10420
+
10421
+ /** UserOperation owner */
10422
+ owner?: (string|null);
10423
+
10424
+ /** UserOperation isAccountDeployed */
10425
+ isAccountDeployed?: (boolean|null);
10426
+
10427
+ /** UserOperation preVerificationGas */
10428
+ preVerificationGas?: (Uint8Array|null);
10429
+
10430
+ /** UserOperation verificationGasLimit */
10431
+ verificationGasLimit?: (Uint8Array|null);
10432
+
10433
+ /** UserOperation paymasterAndData */
10434
+ paymasterAndData?: (Uint8Array|null);
10435
+ }
10436
+
10437
+ /** Represents a UserOperation. */
10438
+ class UserOperation implements IUserOperation {
10439
+
10440
+ /**
10441
+ * Constructs a new UserOperation.
10442
+ * @param [properties] Properties to set
10443
+ */
10444
+ constructor(properties?: TW.Ethereum.Proto.IUserOperation);
10445
+
10446
+ /** UserOperation entryPoint. */
10447
+ public entryPoint: string;
10448
+
10449
+ /** UserOperation accountFactory. */
10450
+ public accountFactory: string;
10451
+
10452
+ /** UserOperation accountLogic. */
10453
+ public accountLogic: string;
10454
+
10455
+ /** UserOperation owner. */
10456
+ public owner: string;
10457
+
10458
+ /** UserOperation isAccountDeployed. */
10459
+ public isAccountDeployed: boolean;
10460
+
10461
+ /** UserOperation preVerificationGas. */
10462
+ public preVerificationGas: Uint8Array;
10463
+
10464
+ /** UserOperation verificationGasLimit. */
10465
+ public verificationGasLimit: Uint8Array;
10466
+
10467
+ /** UserOperation paymasterAndData. */
10468
+ public paymasterAndData: Uint8Array;
10469
+
10470
+ /**
10471
+ * Creates a new UserOperation instance using the specified properties.
10472
+ * @param [properties] Properties to set
10473
+ * @returns UserOperation instance
10474
+ */
10475
+ public static create(properties?: TW.Ethereum.Proto.IUserOperation): TW.Ethereum.Proto.UserOperation;
10476
+
10477
+ /**
10478
+ * Encodes the specified UserOperation message. Does not implicitly {@link TW.Ethereum.Proto.UserOperation.verify|verify} messages.
10479
+ * @param message UserOperation message or plain object to encode
10480
+ * @param [writer] Writer to encode to
10481
+ * @returns Writer
10482
+ */
10483
+ public static encode(message: TW.Ethereum.Proto.IUserOperation, writer?: $protobuf.Writer): $protobuf.Writer;
10484
+
10485
+ /**
10486
+ * Decodes a UserOperation message from the specified reader or buffer.
10487
+ * @param reader Reader or buffer to decode from
10488
+ * @param [length] Message length if known beforehand
10489
+ * @returns UserOperation
10490
+ * @throws {Error} If the payload is not a reader or valid buffer
10491
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
10492
+ */
10493
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): TW.Ethereum.Proto.UserOperation;
10494
+
10495
+ /**
10496
+ * Verifies a UserOperation message.
10497
+ * @param message Plain object to verify
10498
+ * @returns `null` if valid, otherwise the reason why it is not
10499
+ */
10500
+ public static verify(message: { [k: string]: any }): (string|null);
10501
+
10502
+ /**
10503
+ * Creates a UserOperation message from a plain object. Also converts values to their respective internal types.
10504
+ * @param object Plain object
10505
+ * @returns UserOperation
10506
+ */
10507
+ public static fromObject(object: { [k: string]: any }): TW.Ethereum.Proto.UserOperation;
10508
+
10509
+ /**
10510
+ * Creates a plain object from a UserOperation message. Also converts values to other types if specified.
10511
+ * @param message UserOperation
10512
+ * @param [options] Conversion options
10513
+ * @returns Plain object
10514
+ */
10515
+ public static toObject(message: TW.Ethereum.Proto.UserOperation, options?: $protobuf.IConversionOptions): { [k: string]: any };
10516
+
10517
+ /**
10518
+ * Converts this UserOperation to JSON.
10519
+ * @returns JSON object
10520
+ */
10521
+ public toJSON(): { [k: string]: any };
10406
10522
  }
10407
10523
 
10408
10524
  /** Properties of a SigningInput. */
@@ -10437,6 +10553,9 @@ export namespace TW {
10437
10553
 
10438
10554
  /** SigningInput transaction */
10439
10555
  transaction?: (TW.Ethereum.Proto.ITransaction|null);
10556
+
10557
+ /** SigningInput userOperation */
10558
+ userOperation?: (TW.Ethereum.Proto.IUserOperation|null);
10440
10559
  }
10441
10560
 
10442
10561
  /** Represents a SigningInput. */
@@ -10478,6 +10597,9 @@ export namespace TW {
10478
10597
  /** SigningInput transaction. */
10479
10598
  public transaction?: (TW.Ethereum.Proto.ITransaction|null);
10480
10599
 
10600
+ /** SigningInput userOperation. */
10601
+ public userOperation?: (TW.Ethereum.Proto.IUserOperation|null);
10602
+
10481
10603
  /**
10482
10604
  * Creates a new SigningInput instance using the specified properties.
10483
10605
  * @param [properties] Properties to set
@@ -27209,6 +27331,9 @@ export namespace TW {
27209
27331
 
27210
27332
  /** SwapInput extraMemo */
27211
27333
  extraMemo?: (string|null);
27334
+
27335
+ /** SwapInput expirationTime */
27336
+ expirationTime?: (Long|null);
27212
27337
  }
27213
27338
 
27214
27339
  /** Represents a SwapInput. */
@@ -27253,6 +27378,9 @@ export namespace TW {
27253
27378
  /** SwapInput extraMemo. */
27254
27379
  public extraMemo: string;
27255
27380
 
27381
+ /** SwapInput expirationTime. */
27382
+ public expirationTime: Long;
27383
+
27256
27384
  /**
27257
27385
  * Creates a new SwapInput instance using the specified properties.
27258
27386
  * @param [properties] Properties to set
@@ -30692,14 +30692,356 @@
30692
30692
  * @enum {number}
30693
30693
  * @property {number} Legacy=0 Legacy value
30694
30694
  * @property {number} Enveloped=1 Enveloped value
30695
+ * @property {number} UserOp=2 UserOp value
30695
30696
  */
30696
30697
  Proto.TransactionMode = (function() {
30697
30698
  var valuesById = {}, values = Object.create(valuesById);
30698
30699
  values[valuesById[0] = "Legacy"] = 0;
30699
30700
  values[valuesById[1] = "Enveloped"] = 1;
30701
+ values[valuesById[2] = "UserOp"] = 2;
30700
30702
  return values;
30701
30703
  })();
30702
30704
 
30705
+ Proto.UserOperation = (function() {
30706
+
30707
+ /**
30708
+ * Properties of a UserOperation.
30709
+ * @memberof TW.Ethereum.Proto
30710
+ * @interface IUserOperation
30711
+ * @property {string|null} [entryPoint] UserOperation entryPoint
30712
+ * @property {string|null} [accountFactory] UserOperation accountFactory
30713
+ * @property {string|null} [accountLogic] UserOperation accountLogic
30714
+ * @property {string|null} [owner] UserOperation owner
30715
+ * @property {boolean|null} [isAccountDeployed] UserOperation isAccountDeployed
30716
+ * @property {Uint8Array|null} [preVerificationGas] UserOperation preVerificationGas
30717
+ * @property {Uint8Array|null} [verificationGasLimit] UserOperation verificationGasLimit
30718
+ * @property {Uint8Array|null} [paymasterAndData] UserOperation paymasterAndData
30719
+ */
30720
+
30721
+ /**
30722
+ * Constructs a new UserOperation.
30723
+ * @memberof TW.Ethereum.Proto
30724
+ * @classdesc Represents a UserOperation.
30725
+ * @implements IUserOperation
30726
+ * @constructor
30727
+ * @param {TW.Ethereum.Proto.IUserOperation=} [properties] Properties to set
30728
+ */
30729
+ function UserOperation(properties) {
30730
+ if (properties)
30731
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
30732
+ if (properties[keys[i]] != null)
30733
+ this[keys[i]] = properties[keys[i]];
30734
+ }
30735
+
30736
+ /**
30737
+ * UserOperation entryPoint.
30738
+ * @member {string} entryPoint
30739
+ * @memberof TW.Ethereum.Proto.UserOperation
30740
+ * @instance
30741
+ */
30742
+ UserOperation.prototype.entryPoint = "";
30743
+
30744
+ /**
30745
+ * UserOperation accountFactory.
30746
+ * @member {string} accountFactory
30747
+ * @memberof TW.Ethereum.Proto.UserOperation
30748
+ * @instance
30749
+ */
30750
+ UserOperation.prototype.accountFactory = "";
30751
+
30752
+ /**
30753
+ * UserOperation accountLogic.
30754
+ * @member {string} accountLogic
30755
+ * @memberof TW.Ethereum.Proto.UserOperation
30756
+ * @instance
30757
+ */
30758
+ UserOperation.prototype.accountLogic = "";
30759
+
30760
+ /**
30761
+ * UserOperation owner.
30762
+ * @member {string} owner
30763
+ * @memberof TW.Ethereum.Proto.UserOperation
30764
+ * @instance
30765
+ */
30766
+ UserOperation.prototype.owner = "";
30767
+
30768
+ /**
30769
+ * UserOperation isAccountDeployed.
30770
+ * @member {boolean} isAccountDeployed
30771
+ * @memberof TW.Ethereum.Proto.UserOperation
30772
+ * @instance
30773
+ */
30774
+ UserOperation.prototype.isAccountDeployed = false;
30775
+
30776
+ /**
30777
+ * UserOperation preVerificationGas.
30778
+ * @member {Uint8Array} preVerificationGas
30779
+ * @memberof TW.Ethereum.Proto.UserOperation
30780
+ * @instance
30781
+ */
30782
+ UserOperation.prototype.preVerificationGas = $util.newBuffer([]);
30783
+
30784
+ /**
30785
+ * UserOperation verificationGasLimit.
30786
+ * @member {Uint8Array} verificationGasLimit
30787
+ * @memberof TW.Ethereum.Proto.UserOperation
30788
+ * @instance
30789
+ */
30790
+ UserOperation.prototype.verificationGasLimit = $util.newBuffer([]);
30791
+
30792
+ /**
30793
+ * UserOperation paymasterAndData.
30794
+ * @member {Uint8Array} paymasterAndData
30795
+ * @memberof TW.Ethereum.Proto.UserOperation
30796
+ * @instance
30797
+ */
30798
+ UserOperation.prototype.paymasterAndData = $util.newBuffer([]);
30799
+
30800
+ /**
30801
+ * Creates a new UserOperation instance using the specified properties.
30802
+ * @function create
30803
+ * @memberof TW.Ethereum.Proto.UserOperation
30804
+ * @static
30805
+ * @param {TW.Ethereum.Proto.IUserOperation=} [properties] Properties to set
30806
+ * @returns {TW.Ethereum.Proto.UserOperation} UserOperation instance
30807
+ */
30808
+ UserOperation.create = function create(properties) {
30809
+ return new UserOperation(properties);
30810
+ };
30811
+
30812
+ /**
30813
+ * Encodes the specified UserOperation message. Does not implicitly {@link TW.Ethereum.Proto.UserOperation.verify|verify} messages.
30814
+ * @function encode
30815
+ * @memberof TW.Ethereum.Proto.UserOperation
30816
+ * @static
30817
+ * @param {TW.Ethereum.Proto.IUserOperation} message UserOperation message or plain object to encode
30818
+ * @param {$protobuf.Writer} [writer] Writer to encode to
30819
+ * @returns {$protobuf.Writer} Writer
30820
+ */
30821
+ UserOperation.encode = function encode(message, writer) {
30822
+ if (!writer)
30823
+ writer = $Writer.create();
30824
+ if (message.entryPoint != null && Object.hasOwnProperty.call(message, "entryPoint"))
30825
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.entryPoint);
30826
+ if (message.accountFactory != null && Object.hasOwnProperty.call(message, "accountFactory"))
30827
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.accountFactory);
30828
+ if (message.accountLogic != null && Object.hasOwnProperty.call(message, "accountLogic"))
30829
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.accountLogic);
30830
+ if (message.owner != null && Object.hasOwnProperty.call(message, "owner"))
30831
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.owner);
30832
+ if (message.isAccountDeployed != null && Object.hasOwnProperty.call(message, "isAccountDeployed"))
30833
+ writer.uint32(/* id 5, wireType 0 =*/40).bool(message.isAccountDeployed);
30834
+ if (message.preVerificationGas != null && Object.hasOwnProperty.call(message, "preVerificationGas"))
30835
+ writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.preVerificationGas);
30836
+ if (message.verificationGasLimit != null && Object.hasOwnProperty.call(message, "verificationGasLimit"))
30837
+ writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.verificationGasLimit);
30838
+ if (message.paymasterAndData != null && Object.hasOwnProperty.call(message, "paymasterAndData"))
30839
+ writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.paymasterAndData);
30840
+ return writer;
30841
+ };
30842
+
30843
+ /**
30844
+ * Decodes a UserOperation message from the specified reader or buffer.
30845
+ * @function decode
30846
+ * @memberof TW.Ethereum.Proto.UserOperation
30847
+ * @static
30848
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
30849
+ * @param {number} [length] Message length if known beforehand
30850
+ * @returns {TW.Ethereum.Proto.UserOperation} UserOperation
30851
+ * @throws {Error} If the payload is not a reader or valid buffer
30852
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
30853
+ */
30854
+ UserOperation.decode = function decode(reader, length) {
30855
+ if (!(reader instanceof $Reader))
30856
+ reader = $Reader.create(reader);
30857
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ethereum.Proto.UserOperation();
30858
+ while (reader.pos < end) {
30859
+ var tag = reader.uint32();
30860
+ switch (tag >>> 3) {
30861
+ case 1:
30862
+ message.entryPoint = reader.string();
30863
+ break;
30864
+ case 2:
30865
+ message.accountFactory = reader.string();
30866
+ break;
30867
+ case 3:
30868
+ message.accountLogic = reader.string();
30869
+ break;
30870
+ case 4:
30871
+ message.owner = reader.string();
30872
+ break;
30873
+ case 5:
30874
+ message.isAccountDeployed = reader.bool();
30875
+ break;
30876
+ case 6:
30877
+ message.preVerificationGas = reader.bytes();
30878
+ break;
30879
+ case 7:
30880
+ message.verificationGasLimit = reader.bytes();
30881
+ break;
30882
+ case 8:
30883
+ message.paymasterAndData = reader.bytes();
30884
+ break;
30885
+ default:
30886
+ reader.skipType(tag & 7);
30887
+ break;
30888
+ }
30889
+ }
30890
+ return message;
30891
+ };
30892
+
30893
+ /**
30894
+ * Verifies a UserOperation message.
30895
+ * @function verify
30896
+ * @memberof TW.Ethereum.Proto.UserOperation
30897
+ * @static
30898
+ * @param {Object.<string,*>} message Plain object to verify
30899
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
30900
+ */
30901
+ UserOperation.verify = function verify(message) {
30902
+ if (typeof message !== "object" || message === null)
30903
+ return "object expected";
30904
+ if (message.entryPoint != null && message.hasOwnProperty("entryPoint"))
30905
+ if (!$util.isString(message.entryPoint))
30906
+ return "entryPoint: string expected";
30907
+ if (message.accountFactory != null && message.hasOwnProperty("accountFactory"))
30908
+ if (!$util.isString(message.accountFactory))
30909
+ return "accountFactory: string expected";
30910
+ if (message.accountLogic != null && message.hasOwnProperty("accountLogic"))
30911
+ if (!$util.isString(message.accountLogic))
30912
+ return "accountLogic: string expected";
30913
+ if (message.owner != null && message.hasOwnProperty("owner"))
30914
+ if (!$util.isString(message.owner))
30915
+ return "owner: string expected";
30916
+ if (message.isAccountDeployed != null && message.hasOwnProperty("isAccountDeployed"))
30917
+ if (typeof message.isAccountDeployed !== "boolean")
30918
+ return "isAccountDeployed: boolean expected";
30919
+ if (message.preVerificationGas != null && message.hasOwnProperty("preVerificationGas"))
30920
+ if (!(message.preVerificationGas && typeof message.preVerificationGas.length === "number" || $util.isString(message.preVerificationGas)))
30921
+ return "preVerificationGas: buffer expected";
30922
+ if (message.verificationGasLimit != null && message.hasOwnProperty("verificationGasLimit"))
30923
+ if (!(message.verificationGasLimit && typeof message.verificationGasLimit.length === "number" || $util.isString(message.verificationGasLimit)))
30924
+ return "verificationGasLimit: buffer expected";
30925
+ if (message.paymasterAndData != null && message.hasOwnProperty("paymasterAndData"))
30926
+ if (!(message.paymasterAndData && typeof message.paymasterAndData.length === "number" || $util.isString(message.paymasterAndData)))
30927
+ return "paymasterAndData: buffer expected";
30928
+ return null;
30929
+ };
30930
+
30931
+ /**
30932
+ * Creates a UserOperation message from a plain object. Also converts values to their respective internal types.
30933
+ * @function fromObject
30934
+ * @memberof TW.Ethereum.Proto.UserOperation
30935
+ * @static
30936
+ * @param {Object.<string,*>} object Plain object
30937
+ * @returns {TW.Ethereum.Proto.UserOperation} UserOperation
30938
+ */
30939
+ UserOperation.fromObject = function fromObject(object) {
30940
+ if (object instanceof $root.TW.Ethereum.Proto.UserOperation)
30941
+ return object;
30942
+ var message = new $root.TW.Ethereum.Proto.UserOperation();
30943
+ if (object.entryPoint != null)
30944
+ message.entryPoint = String(object.entryPoint);
30945
+ if (object.accountFactory != null)
30946
+ message.accountFactory = String(object.accountFactory);
30947
+ if (object.accountLogic != null)
30948
+ message.accountLogic = String(object.accountLogic);
30949
+ if (object.owner != null)
30950
+ message.owner = String(object.owner);
30951
+ if (object.isAccountDeployed != null)
30952
+ message.isAccountDeployed = Boolean(object.isAccountDeployed);
30953
+ if (object.preVerificationGas != null)
30954
+ if (typeof object.preVerificationGas === "string")
30955
+ $util.base64.decode(object.preVerificationGas, message.preVerificationGas = $util.newBuffer($util.base64.length(object.preVerificationGas)), 0);
30956
+ else if (object.preVerificationGas.length)
30957
+ message.preVerificationGas = object.preVerificationGas;
30958
+ if (object.verificationGasLimit != null)
30959
+ if (typeof object.verificationGasLimit === "string")
30960
+ $util.base64.decode(object.verificationGasLimit, message.verificationGasLimit = $util.newBuffer($util.base64.length(object.verificationGasLimit)), 0);
30961
+ else if (object.verificationGasLimit.length)
30962
+ message.verificationGasLimit = object.verificationGasLimit;
30963
+ if (object.paymasterAndData != null)
30964
+ if (typeof object.paymasterAndData === "string")
30965
+ $util.base64.decode(object.paymasterAndData, message.paymasterAndData = $util.newBuffer($util.base64.length(object.paymasterAndData)), 0);
30966
+ else if (object.paymasterAndData.length)
30967
+ message.paymasterAndData = object.paymasterAndData;
30968
+ return message;
30969
+ };
30970
+
30971
+ /**
30972
+ * Creates a plain object from a UserOperation message. Also converts values to other types if specified.
30973
+ * @function toObject
30974
+ * @memberof TW.Ethereum.Proto.UserOperation
30975
+ * @static
30976
+ * @param {TW.Ethereum.Proto.UserOperation} message UserOperation
30977
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
30978
+ * @returns {Object.<string,*>} Plain object
30979
+ */
30980
+ UserOperation.toObject = function toObject(message, options) {
30981
+ if (!options)
30982
+ options = {};
30983
+ var object = {};
30984
+ if (options.defaults) {
30985
+ object.entryPoint = "";
30986
+ object.accountFactory = "";
30987
+ object.accountLogic = "";
30988
+ object.owner = "";
30989
+ object.isAccountDeployed = false;
30990
+ if (options.bytes === String)
30991
+ object.preVerificationGas = "";
30992
+ else {
30993
+ object.preVerificationGas = [];
30994
+ if (options.bytes !== Array)
30995
+ object.preVerificationGas = $util.newBuffer(object.preVerificationGas);
30996
+ }
30997
+ if (options.bytes === String)
30998
+ object.verificationGasLimit = "";
30999
+ else {
31000
+ object.verificationGasLimit = [];
31001
+ if (options.bytes !== Array)
31002
+ object.verificationGasLimit = $util.newBuffer(object.verificationGasLimit);
31003
+ }
31004
+ if (options.bytes === String)
31005
+ object.paymasterAndData = "";
31006
+ else {
31007
+ object.paymasterAndData = [];
31008
+ if (options.bytes !== Array)
31009
+ object.paymasterAndData = $util.newBuffer(object.paymasterAndData);
31010
+ }
31011
+ }
31012
+ if (message.entryPoint != null && message.hasOwnProperty("entryPoint"))
31013
+ object.entryPoint = message.entryPoint;
31014
+ if (message.accountFactory != null && message.hasOwnProperty("accountFactory"))
31015
+ object.accountFactory = message.accountFactory;
31016
+ if (message.accountLogic != null && message.hasOwnProperty("accountLogic"))
31017
+ object.accountLogic = message.accountLogic;
31018
+ if (message.owner != null && message.hasOwnProperty("owner"))
31019
+ object.owner = message.owner;
31020
+ if (message.isAccountDeployed != null && message.hasOwnProperty("isAccountDeployed"))
31021
+ object.isAccountDeployed = message.isAccountDeployed;
31022
+ if (message.preVerificationGas != null && message.hasOwnProperty("preVerificationGas"))
31023
+ object.preVerificationGas = options.bytes === String ? $util.base64.encode(message.preVerificationGas, 0, message.preVerificationGas.length) : options.bytes === Array ? Array.prototype.slice.call(message.preVerificationGas) : message.preVerificationGas;
31024
+ if (message.verificationGasLimit != null && message.hasOwnProperty("verificationGasLimit"))
31025
+ object.verificationGasLimit = options.bytes === String ? $util.base64.encode(message.verificationGasLimit, 0, message.verificationGasLimit.length) : options.bytes === Array ? Array.prototype.slice.call(message.verificationGasLimit) : message.verificationGasLimit;
31026
+ if (message.paymasterAndData != null && message.hasOwnProperty("paymasterAndData"))
31027
+ object.paymasterAndData = options.bytes === String ? $util.base64.encode(message.paymasterAndData, 0, message.paymasterAndData.length) : options.bytes === Array ? Array.prototype.slice.call(message.paymasterAndData) : message.paymasterAndData;
31028
+ return object;
31029
+ };
31030
+
31031
+ /**
31032
+ * Converts this UserOperation to JSON.
31033
+ * @function toJSON
31034
+ * @memberof TW.Ethereum.Proto.UserOperation
31035
+ * @instance
31036
+ * @returns {Object.<string,*>} JSON object
31037
+ */
31038
+ UserOperation.prototype.toJSON = function toJSON() {
31039
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
31040
+ };
31041
+
31042
+ return UserOperation;
31043
+ })();
31044
+
30703
31045
  Proto.SigningInput = (function() {
30704
31046
 
30705
31047
  /**
@@ -30716,6 +31058,7 @@
30716
31058
  * @property {string|null} [toAddress] SigningInput toAddress
30717
31059
  * @property {Uint8Array|null} [privateKey] SigningInput privateKey
30718
31060
  * @property {TW.Ethereum.Proto.ITransaction|null} [transaction] SigningInput transaction
31061
+ * @property {TW.Ethereum.Proto.IUserOperation|null} [userOperation] SigningInput userOperation
30719
31062
  */
30720
31063
 
30721
31064
  /**
@@ -30813,6 +31156,14 @@
30813
31156
  */
30814
31157
  SigningInput.prototype.transaction = null;
30815
31158
 
31159
+ /**
31160
+ * SigningInput userOperation.
31161
+ * @member {TW.Ethereum.Proto.IUserOperation|null|undefined} userOperation
31162
+ * @memberof TW.Ethereum.Proto.SigningInput
31163
+ * @instance
31164
+ */
31165
+ SigningInput.prototype.userOperation = null;
31166
+
30816
31167
  /**
30817
31168
  * Creates a new SigningInput instance using the specified properties.
30818
31169
  * @function create
@@ -30857,6 +31208,8 @@
30857
31208
  writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.privateKey);
30858
31209
  if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction"))
30859
31210
  $root.TW.Ethereum.Proto.Transaction.encode(message.transaction, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
31211
+ if (message.userOperation != null && Object.hasOwnProperty.call(message, "userOperation"))
31212
+ $root.TW.Ethereum.Proto.UserOperation.encode(message.userOperation, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
30860
31213
  return writer;
30861
31214
  };
30862
31215
 
@@ -30908,6 +31261,9 @@
30908
31261
  case 10:
30909
31262
  message.transaction = $root.TW.Ethereum.Proto.Transaction.decode(reader, reader.uint32());
30910
31263
  break;
31264
+ case 11:
31265
+ message.userOperation = $root.TW.Ethereum.Proto.UserOperation.decode(reader, reader.uint32());
31266
+ break;
30911
31267
  default:
30912
31268
  reader.skipType(tag & 7);
30913
31269
  break;
@@ -30939,6 +31295,7 @@
30939
31295
  return "txMode: enum value expected";
30940
31296
  case 0:
30941
31297
  case 1:
31298
+ case 2:
30942
31299
  break;
30943
31300
  }
30944
31301
  if (message.gasPrice != null && message.hasOwnProperty("gasPrice"))
@@ -30964,6 +31321,11 @@
30964
31321
  if (error)
30965
31322
  return "transaction." + error;
30966
31323
  }
31324
+ if (message.userOperation != null && message.hasOwnProperty("userOperation")) {
31325
+ var error = $root.TW.Ethereum.Proto.UserOperation.verify(message.userOperation);
31326
+ if (error)
31327
+ return "userOperation." + error;
31328
+ }
30967
31329
  return null;
30968
31330
  };
30969
31331
 
@@ -30998,6 +31360,10 @@
30998
31360
  case 1:
30999
31361
  message.txMode = 1;
31000
31362
  break;
31363
+ case "UserOp":
31364
+ case 2:
31365
+ message.txMode = 2;
31366
+ break;
31001
31367
  }
31002
31368
  if (object.gasPrice != null)
31003
31369
  if (typeof object.gasPrice === "string")
@@ -31031,6 +31397,11 @@
31031
31397
  throw TypeError(".TW.Ethereum.Proto.SigningInput.transaction: object expected");
31032
31398
  message.transaction = $root.TW.Ethereum.Proto.Transaction.fromObject(object.transaction);
31033
31399
  }
31400
+ if (object.userOperation != null) {
31401
+ if (typeof object.userOperation !== "object")
31402
+ throw TypeError(".TW.Ethereum.Proto.SigningInput.userOperation: object expected");
31403
+ message.userOperation = $root.TW.Ethereum.Proto.UserOperation.fromObject(object.userOperation);
31404
+ }
31034
31405
  return message;
31035
31406
  };
31036
31407
 
@@ -31100,6 +31471,7 @@
31100
31471
  object.privateKey = $util.newBuffer(object.privateKey);
31101
31472
  }
31102
31473
  object.transaction = null;
31474
+ object.userOperation = null;
31103
31475
  }
31104
31476
  if (message.chainId != null && message.hasOwnProperty("chainId"))
31105
31477
  object.chainId = options.bytes === String ? $util.base64.encode(message.chainId, 0, message.chainId.length) : options.bytes === Array ? Array.prototype.slice.call(message.chainId) : message.chainId;
@@ -31121,6 +31493,8 @@
31121
31493
  object.privateKey = options.bytes === String ? $util.base64.encode(message.privateKey, 0, message.privateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.privateKey) : message.privateKey;
31122
31494
  if (message.transaction != null && message.hasOwnProperty("transaction"))
31123
31495
  object.transaction = $root.TW.Ethereum.Proto.Transaction.toObject(message.transaction, options);
31496
+ if (message.userOperation != null && message.hasOwnProperty("userOperation"))
31497
+ object.userOperation = $root.TW.Ethereum.Proto.UserOperation.toObject(message.userOperation, options);
31124
31498
  return object;
31125
31499
  };
31126
31500
 
@@ -77899,6 +78273,7 @@
77899
78273
  * @property {string|null} [affiliateFeeAddress] SwapInput affiliateFeeAddress
77900
78274
  * @property {string|null} [affiliateFeeRateBp] SwapInput affiliateFeeRateBp
77901
78275
  * @property {string|null} [extraMemo] SwapInput extraMemo
78276
+ * @property {Long|null} [expirationTime] SwapInput expirationTime
77902
78277
  */
77903
78278
 
77904
78279
  /**
@@ -78004,6 +78379,14 @@
78004
78379
  */
78005
78380
  SwapInput.prototype.extraMemo = "";
78006
78381
 
78382
+ /**
78383
+ * SwapInput expirationTime.
78384
+ * @member {Long} expirationTime
78385
+ * @memberof TW.THORChainSwap.Proto.SwapInput
78386
+ * @instance
78387
+ */
78388
+ SwapInput.prototype.expirationTime = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
78389
+
78007
78390
  /**
78008
78391
  * Creates a new SwapInput instance using the specified properties.
78009
78392
  * @function create
@@ -78050,6 +78433,8 @@
78050
78433
  writer.uint32(/* id 10, wireType 2 =*/82).string(message.affiliateFeeRateBp);
78051
78434
  if (message.extraMemo != null && Object.hasOwnProperty.call(message, "extraMemo"))
78052
78435
  writer.uint32(/* id 11, wireType 2 =*/90).string(message.extraMemo);
78436
+ if (message.expirationTime != null && Object.hasOwnProperty.call(message, "expirationTime"))
78437
+ writer.uint32(/* id 12, wireType 0 =*/96).uint64(message.expirationTime);
78053
78438
  return writer;
78054
78439
  };
78055
78440
 
@@ -78104,6 +78489,9 @@
78104
78489
  case 11:
78105
78490
  message.extraMemo = reader.string();
78106
78491
  break;
78492
+ case 12:
78493
+ message.expirationTime = reader.uint64();
78494
+ break;
78107
78495
  default:
78108
78496
  reader.skipType(tag & 7);
78109
78497
  break;
@@ -78160,6 +78548,9 @@
78160
78548
  if (message.extraMemo != null && message.hasOwnProperty("extraMemo"))
78161
78549
  if (!$util.isString(message.extraMemo))
78162
78550
  return "extraMemo: string expected";
78551
+ if (message.expirationTime != null && message.hasOwnProperty("expirationTime"))
78552
+ if (!$util.isInteger(message.expirationTime) && !(message.expirationTime && $util.isInteger(message.expirationTime.low) && $util.isInteger(message.expirationTime.high)))
78553
+ return "expirationTime: integer|Long expected";
78163
78554
  return null;
78164
78555
  };
78165
78556
 
@@ -78203,6 +78594,15 @@
78203
78594
  message.affiliateFeeRateBp = String(object.affiliateFeeRateBp);
78204
78595
  if (object.extraMemo != null)
78205
78596
  message.extraMemo = String(object.extraMemo);
78597
+ if (object.expirationTime != null)
78598
+ if ($util.Long)
78599
+ (message.expirationTime = $util.Long.fromValue(object.expirationTime)).unsigned = true;
78600
+ else if (typeof object.expirationTime === "string")
78601
+ message.expirationTime = parseInt(object.expirationTime, 10);
78602
+ else if (typeof object.expirationTime === "number")
78603
+ message.expirationTime = object.expirationTime;
78604
+ else if (typeof object.expirationTime === "object")
78605
+ message.expirationTime = new $util.LongBits(object.expirationTime.low >>> 0, object.expirationTime.high >>> 0).toNumber(true);
78206
78606
  return message;
78207
78607
  };
78208
78608
 
@@ -78231,6 +78631,11 @@
78231
78631
  object.affiliateFeeAddress = "";
78232
78632
  object.affiliateFeeRateBp = "";
78233
78633
  object.extraMemo = "";
78634
+ if ($util.Long) {
78635
+ var long = new $util.Long(0, 0, true);
78636
+ object.expirationTime = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
78637
+ } else
78638
+ object.expirationTime = options.longs === String ? "0" : 0;
78234
78639
  }
78235
78640
  if (message.fromAsset != null && message.hasOwnProperty("fromAsset"))
78236
78641
  object.fromAsset = $root.TW.THORChainSwap.Proto.Asset.toObject(message.fromAsset, options);
@@ -78254,6 +78659,11 @@
78254
78659
  object.affiliateFeeRateBp = message.affiliateFeeRateBp;
78255
78660
  if (message.extraMemo != null && message.hasOwnProperty("extraMemo"))
78256
78661
  object.extraMemo = message.extraMemo;
78662
+ if (message.expirationTime != null && message.hasOwnProperty("expirationTime"))
78663
+ if (typeof message.expirationTime === "number")
78664
+ object.expirationTime = options.longs === String ? String(message.expirationTime) : message.expirationTime;
78665
+ else
78666
+ object.expirationTime = options.longs === String ? $util.Long.prototype.toString.call(message.expirationTime) : options.longs === Number ? new $util.LongBits(message.expirationTime.low >>> 0, message.expirationTime.high >>> 0).toNumber(true) : message.expirationTime;
78257
78667
  return object;
78258
78668
  };
78259
78669
 
@@ -34,7 +34,7 @@ function Ua(){Qa++;g.monitorRunDependencies&&g.monitorRunDependencies(Qa);assert
34
34
  function Va(){return G.startsWith("data:application/octet-stream;base64,")}function ma(a){return a.startsWith("file://")}function H(a){return function(){var b=g.asm;assert(Oa,"native function `"+a+"` called before runtime initialization");b[a]||assert(b[a],"exported native function `"+a+"` not found");return b[a].apply(null,arguments)}}var G;G="wallet-core.wasm";if(!Va()){var Wa=G;G=g.locateFile?g.locateFile(Wa,x):x+Wa}
35
35
  function Xa(){var a=G;try{if(a==G&&qa)return new Uint8Array(qa);if(ka)return ka(a);throw"both async and sync fetching of the wasm failed";}catch(b){n(b)}}
36
36
  function Ya(){if(!qa&&(ea||fa)){if("function"==typeof fetch&&!ma(G))return fetch(G,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+G+"'";return a.arrayBuffer()}).catch(function(){return Xa()});if(ja)return new Promise(function(a,b){ja(G,function(c){a(new Uint8Array(c))},b)})}return Promise.resolve().then(function(){return Xa()})}
37
- var Za,$a,ab={638868:()=>{if(void 0===g.ea)try{var a="object"===typeof window?window:self,b="undefined"!==typeof a.crypto?a.crypto:a.msCrypto;a=function(){var d=new Uint32Array(1);b.getRandomValues(d);return d[0]>>>0};a();g.ea=a}catch(d){try{var c=require("crypto");a=function(){var e=c.randomBytes(4);return(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0};a();g.ea=a}catch(e){throw"No secure random number generator found";}}},639590:()=>g.ea()};function bb(a){for(;0<a.length;)a.shift()(g)}
37
+ var Za,$a,ab={641060:()=>{if(void 0===g.ea)try{var a="object"===typeof window?window:self,b="undefined"!==typeof a.crypto?a.crypto:a.msCrypto;a=function(){var d=new Uint32Array(1);b.getRandomValues(d);return d[0]>>>0};a();g.ea=a}catch(d){try{var c=require("crypto");a=function(){var e=c.randomBytes(4);return(e[0]<<24|e[1]<<16|e[2]<<8|e[3])>>>0};a();g.ea=a}catch(e){throw"No secure random number generator found";}}},641782:()=>g.ea()};function bb(a){for(;0<a.length;)a.shift()(g)}
38
38
  function va(a){assert("number"===typeof a);return"0x"+a.toString(16).padStart(8,"0")}function pa(a){cb||(cb={});cb[a]||(cb[a]=1,v&&(a="warning: "+a),y(a))}var cb,db=0;
39
39
  function eb(a){this.l=a-24;this.Sa=function(b){F[this.l+4>>2]=b};this.Ca=function(){return F[this.l+4>>2]};this.Ia=function(b){F[this.l+8>>2]=b};this.Ja=function(){E[this.l>>2]=0};this.Ha=function(){C[this.l+12>>0]=0};this.Ma=function(){C[this.l+13>>0]=0};this.Da=function(b,c){this.F(0);this.Sa(b);this.Ia(c);this.Ja();this.Ha();this.Ma()};this.F=function(b){F[this.l+16>>2]=b}}
40
40
  var fb=0,gb=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},hb=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=gb(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},ib=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&(b=b.substr(0,b.length-1));return a+b},jb=
Binary file
@@ -339,7 +339,6 @@ export class DerivationPathIndex {
339
339
  delete(): void;
340
340
  }
341
341
  export class Ethereum {
342
- static eip1014AddressCreate2(fromEthAddress: string, salt: Uint8Array | Buffer, initCodeHash: Uint8Array | Buffer): string;
343
342
  static eip2645GetPath(ethAddress: string, layer: string, application: string, index: string): string;
344
343
  static eip4337GetDeploymentAddress(factoryAddress: string, logicAddress: string, ownerAddress: string): string;
345
344
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustwallet/wallet-core",
3
- "version": "3.1.11",
3
+ "version": "3.1.12",
4
4
  "description": "wallet core wasm and protobuf models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",