@trustwallet/wallet-core 4.2.14 → 4.2.16-rc1

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.
@@ -16703,6 +16703,133 @@ export namespace TW {
16703
16703
  public toJSON(): { [k: string]: any };
16704
16704
  }
16705
16705
 
16706
+ /** Properties of a UserOperationV0_7. */
16707
+ interface IUserOperationV0_7 {
16708
+
16709
+ /** UserOperationV0_7 entryPoint */
16710
+ entryPoint?: (string|null);
16711
+
16712
+ /** UserOperationV0_7 factory */
16713
+ factory?: (string|null);
16714
+
16715
+ /** UserOperationV0_7 factoryData */
16716
+ factoryData?: (Uint8Array|null);
16717
+
16718
+ /** UserOperationV0_7 sender */
16719
+ sender?: (string|null);
16720
+
16721
+ /** UserOperationV0_7 preVerificationGas */
16722
+ preVerificationGas?: (Uint8Array|null);
16723
+
16724
+ /** UserOperationV0_7 verificationGasLimit */
16725
+ verificationGasLimit?: (Uint8Array|null);
16726
+
16727
+ /** UserOperationV0_7 paymaster */
16728
+ paymaster?: (string|null);
16729
+
16730
+ /** UserOperationV0_7 paymasterVerificationGasLimit */
16731
+ paymasterVerificationGasLimit?: (Uint8Array|null);
16732
+
16733
+ /** UserOperationV0_7 paymasterPostOpGasLimit */
16734
+ paymasterPostOpGasLimit?: (Uint8Array|null);
16735
+
16736
+ /** UserOperationV0_7 paymasterData */
16737
+ paymasterData?: (Uint8Array|null);
16738
+ }
16739
+
16740
+ /** Represents a UserOperationV0_7. */
16741
+ class UserOperationV0_7 implements IUserOperationV0_7 {
16742
+
16743
+ /**
16744
+ * Constructs a new UserOperationV0_7.
16745
+ * @param [properties] Properties to set
16746
+ */
16747
+ constructor(properties?: TW.Ethereum.Proto.IUserOperationV0_7);
16748
+
16749
+ /** UserOperationV0_7 entryPoint. */
16750
+ public entryPoint: string;
16751
+
16752
+ /** UserOperationV0_7 factory. */
16753
+ public factory: string;
16754
+
16755
+ /** UserOperationV0_7 factoryData. */
16756
+ public factoryData: Uint8Array;
16757
+
16758
+ /** UserOperationV0_7 sender. */
16759
+ public sender: string;
16760
+
16761
+ /** UserOperationV0_7 preVerificationGas. */
16762
+ public preVerificationGas: Uint8Array;
16763
+
16764
+ /** UserOperationV0_7 verificationGasLimit. */
16765
+ public verificationGasLimit: Uint8Array;
16766
+
16767
+ /** UserOperationV0_7 paymaster. */
16768
+ public paymaster: string;
16769
+
16770
+ /** UserOperationV0_7 paymasterVerificationGasLimit. */
16771
+ public paymasterVerificationGasLimit: Uint8Array;
16772
+
16773
+ /** UserOperationV0_7 paymasterPostOpGasLimit. */
16774
+ public paymasterPostOpGasLimit: Uint8Array;
16775
+
16776
+ /** UserOperationV0_7 paymasterData. */
16777
+ public paymasterData: Uint8Array;
16778
+
16779
+ /**
16780
+ * Creates a new UserOperationV0_7 instance using the specified properties.
16781
+ * @param [properties] Properties to set
16782
+ * @returns UserOperationV0_7 instance
16783
+ */
16784
+ public static create(properties?: TW.Ethereum.Proto.IUserOperationV0_7): TW.Ethereum.Proto.UserOperationV0_7;
16785
+
16786
+ /**
16787
+ * Encodes the specified UserOperationV0_7 message. Does not implicitly {@link TW.Ethereum.Proto.UserOperationV0_7.verify|verify} messages.
16788
+ * @param message UserOperationV0_7 message or plain object to encode
16789
+ * @param [writer] Writer to encode to
16790
+ * @returns Writer
16791
+ */
16792
+ public static encode(message: TW.Ethereum.Proto.IUserOperationV0_7, writer?: $protobuf.Writer): $protobuf.Writer;
16793
+
16794
+ /**
16795
+ * Decodes a UserOperationV0_7 message from the specified reader or buffer.
16796
+ * @param reader Reader or buffer to decode from
16797
+ * @param [length] Message length if known beforehand
16798
+ * @returns UserOperationV0_7
16799
+ * @throws {Error} If the payload is not a reader or valid buffer
16800
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
16801
+ */
16802
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): TW.Ethereum.Proto.UserOperationV0_7;
16803
+
16804
+ /**
16805
+ * Verifies a UserOperationV0_7 message.
16806
+ * @param message Plain object to verify
16807
+ * @returns `null` if valid, otherwise the reason why it is not
16808
+ */
16809
+ public static verify(message: { [k: string]: any }): (string|null);
16810
+
16811
+ /**
16812
+ * Creates a UserOperationV0_7 message from a plain object. Also converts values to their respective internal types.
16813
+ * @param object Plain object
16814
+ * @returns UserOperationV0_7
16815
+ */
16816
+ public static fromObject(object: { [k: string]: any }): TW.Ethereum.Proto.UserOperationV0_7;
16817
+
16818
+ /**
16819
+ * Creates a plain object from a UserOperationV0_7 message. Also converts values to other types if specified.
16820
+ * @param message UserOperationV0_7
16821
+ * @param [options] Conversion options
16822
+ * @returns Plain object
16823
+ */
16824
+ public static toObject(message: TW.Ethereum.Proto.UserOperationV0_7, options?: $protobuf.IConversionOptions): { [k: string]: any };
16825
+
16826
+ /**
16827
+ * Converts this UserOperationV0_7 to JSON.
16828
+ * @returns JSON object
16829
+ */
16830
+ public toJSON(): { [k: string]: any };
16831
+ }
16832
+
16706
16833
  /** Properties of an Access. */
16707
16834
  interface IAccess {
16708
16835
 
@@ -16818,6 +16945,9 @@ export namespace TW {
16818
16945
  /** SigningInput userOperation */
16819
16946
  userOperation?: (TW.Ethereum.Proto.IUserOperation|null);
16820
16947
 
16948
+ /** SigningInput userOperationV0_7 */
16949
+ userOperationV0_7?: (TW.Ethereum.Proto.IUserOperationV0_7|null);
16950
+
16821
16951
  /** SigningInput accessList */
16822
16952
  accessList?: (TW.Ethereum.Proto.IAccess[]|null);
16823
16953
  }
@@ -16864,9 +16994,15 @@ export namespace TW {
16864
16994
  /** SigningInput userOperation. */
16865
16995
  public userOperation?: (TW.Ethereum.Proto.IUserOperation|null);
16866
16996
 
16997
+ /** SigningInput userOperationV0_7. */
16998
+ public userOperationV0_7?: (TW.Ethereum.Proto.IUserOperationV0_7|null);
16999
+
16867
17000
  /** SigningInput accessList. */
16868
17001
  public accessList: TW.Ethereum.Proto.IAccess[];
16869
17002
 
17003
+ /** SigningInput userOperationOneof. */
17004
+ public userOperationOneof?: ("userOperation"|"userOperationV0_7");
17005
+
16870
17006
  /**
16871
17007
  * Creates a new SigningInput instance using the specified properties.
16872
17008
  * @param [properties] Properties to set
@@ -49574,6 +49574,417 @@
49574
49574
  return UserOperation;
49575
49575
  })();
49576
49576
 
49577
+ Proto.UserOperationV0_7 = (function() {
49578
+
49579
+ /**
49580
+ * Properties of a UserOperationV0_7.
49581
+ * @memberof TW.Ethereum.Proto
49582
+ * @interface IUserOperationV0_7
49583
+ * @property {string|null} [entryPoint] UserOperationV0_7 entryPoint
49584
+ * @property {string|null} [factory] UserOperationV0_7 factory
49585
+ * @property {Uint8Array|null} [factoryData] UserOperationV0_7 factoryData
49586
+ * @property {string|null} [sender] UserOperationV0_7 sender
49587
+ * @property {Uint8Array|null} [preVerificationGas] UserOperationV0_7 preVerificationGas
49588
+ * @property {Uint8Array|null} [verificationGasLimit] UserOperationV0_7 verificationGasLimit
49589
+ * @property {string|null} [paymaster] UserOperationV0_7 paymaster
49590
+ * @property {Uint8Array|null} [paymasterVerificationGasLimit] UserOperationV0_7 paymasterVerificationGasLimit
49591
+ * @property {Uint8Array|null} [paymasterPostOpGasLimit] UserOperationV0_7 paymasterPostOpGasLimit
49592
+ * @property {Uint8Array|null} [paymasterData] UserOperationV0_7 paymasterData
49593
+ */
49594
+
49595
+ /**
49596
+ * Constructs a new UserOperationV0_7.
49597
+ * @memberof TW.Ethereum.Proto
49598
+ * @classdesc Represents a UserOperationV0_7.
49599
+ * @implements IUserOperationV0_7
49600
+ * @constructor
49601
+ * @param {TW.Ethereum.Proto.IUserOperationV0_7=} [properties] Properties to set
49602
+ */
49603
+ function UserOperationV0_7(properties) {
49604
+ if (properties)
49605
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
49606
+ if (properties[keys[i]] != null)
49607
+ this[keys[i]] = properties[keys[i]];
49608
+ }
49609
+
49610
+ /**
49611
+ * UserOperationV0_7 entryPoint.
49612
+ * @member {string} entryPoint
49613
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49614
+ * @instance
49615
+ */
49616
+ UserOperationV0_7.prototype.entryPoint = "";
49617
+
49618
+ /**
49619
+ * UserOperationV0_7 factory.
49620
+ * @member {string} factory
49621
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49622
+ * @instance
49623
+ */
49624
+ UserOperationV0_7.prototype.factory = "";
49625
+
49626
+ /**
49627
+ * UserOperationV0_7 factoryData.
49628
+ * @member {Uint8Array} factoryData
49629
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49630
+ * @instance
49631
+ */
49632
+ UserOperationV0_7.prototype.factoryData = $util.newBuffer([]);
49633
+
49634
+ /**
49635
+ * UserOperationV0_7 sender.
49636
+ * @member {string} sender
49637
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49638
+ * @instance
49639
+ */
49640
+ UserOperationV0_7.prototype.sender = "";
49641
+
49642
+ /**
49643
+ * UserOperationV0_7 preVerificationGas.
49644
+ * @member {Uint8Array} preVerificationGas
49645
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49646
+ * @instance
49647
+ */
49648
+ UserOperationV0_7.prototype.preVerificationGas = $util.newBuffer([]);
49649
+
49650
+ /**
49651
+ * UserOperationV0_7 verificationGasLimit.
49652
+ * @member {Uint8Array} verificationGasLimit
49653
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49654
+ * @instance
49655
+ */
49656
+ UserOperationV0_7.prototype.verificationGasLimit = $util.newBuffer([]);
49657
+
49658
+ /**
49659
+ * UserOperationV0_7 paymaster.
49660
+ * @member {string} paymaster
49661
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49662
+ * @instance
49663
+ */
49664
+ UserOperationV0_7.prototype.paymaster = "";
49665
+
49666
+ /**
49667
+ * UserOperationV0_7 paymasterVerificationGasLimit.
49668
+ * @member {Uint8Array} paymasterVerificationGasLimit
49669
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49670
+ * @instance
49671
+ */
49672
+ UserOperationV0_7.prototype.paymasterVerificationGasLimit = $util.newBuffer([]);
49673
+
49674
+ /**
49675
+ * UserOperationV0_7 paymasterPostOpGasLimit.
49676
+ * @member {Uint8Array} paymasterPostOpGasLimit
49677
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49678
+ * @instance
49679
+ */
49680
+ UserOperationV0_7.prototype.paymasterPostOpGasLimit = $util.newBuffer([]);
49681
+
49682
+ /**
49683
+ * UserOperationV0_7 paymasterData.
49684
+ * @member {Uint8Array} paymasterData
49685
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49686
+ * @instance
49687
+ */
49688
+ UserOperationV0_7.prototype.paymasterData = $util.newBuffer([]);
49689
+
49690
+ /**
49691
+ * Creates a new UserOperationV0_7 instance using the specified properties.
49692
+ * @function create
49693
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49694
+ * @static
49695
+ * @param {TW.Ethereum.Proto.IUserOperationV0_7=} [properties] Properties to set
49696
+ * @returns {TW.Ethereum.Proto.UserOperationV0_7} UserOperationV0_7 instance
49697
+ */
49698
+ UserOperationV0_7.create = function create(properties) {
49699
+ return new UserOperationV0_7(properties);
49700
+ };
49701
+
49702
+ /**
49703
+ * Encodes the specified UserOperationV0_7 message. Does not implicitly {@link TW.Ethereum.Proto.UserOperationV0_7.verify|verify} messages.
49704
+ * @function encode
49705
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49706
+ * @static
49707
+ * @param {TW.Ethereum.Proto.IUserOperationV0_7} message UserOperationV0_7 message or plain object to encode
49708
+ * @param {$protobuf.Writer} [writer] Writer to encode to
49709
+ * @returns {$protobuf.Writer} Writer
49710
+ */
49711
+ UserOperationV0_7.encode = function encode(message, writer) {
49712
+ if (!writer)
49713
+ writer = $Writer.create();
49714
+ if (message.entryPoint != null && Object.hasOwnProperty.call(message, "entryPoint"))
49715
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.entryPoint);
49716
+ if (message.factory != null && Object.hasOwnProperty.call(message, "factory"))
49717
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.factory);
49718
+ if (message.factoryData != null && Object.hasOwnProperty.call(message, "factoryData"))
49719
+ writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.factoryData);
49720
+ if (message.sender != null && Object.hasOwnProperty.call(message, "sender"))
49721
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.sender);
49722
+ if (message.preVerificationGas != null && Object.hasOwnProperty.call(message, "preVerificationGas"))
49723
+ writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.preVerificationGas);
49724
+ if (message.verificationGasLimit != null && Object.hasOwnProperty.call(message, "verificationGasLimit"))
49725
+ writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.verificationGasLimit);
49726
+ if (message.paymaster != null && Object.hasOwnProperty.call(message, "paymaster"))
49727
+ writer.uint32(/* id 7, wireType 2 =*/58).string(message.paymaster);
49728
+ if (message.paymasterVerificationGasLimit != null && Object.hasOwnProperty.call(message, "paymasterVerificationGasLimit"))
49729
+ writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.paymasterVerificationGasLimit);
49730
+ if (message.paymasterPostOpGasLimit != null && Object.hasOwnProperty.call(message, "paymasterPostOpGasLimit"))
49731
+ writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.paymasterPostOpGasLimit);
49732
+ if (message.paymasterData != null && Object.hasOwnProperty.call(message, "paymasterData"))
49733
+ writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.paymasterData);
49734
+ return writer;
49735
+ };
49736
+
49737
+ /**
49738
+ * Decodes a UserOperationV0_7 message from the specified reader or buffer.
49739
+ * @function decode
49740
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49741
+ * @static
49742
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
49743
+ * @param {number} [length] Message length if known beforehand
49744
+ * @returns {TW.Ethereum.Proto.UserOperationV0_7} UserOperationV0_7
49745
+ * @throws {Error} If the payload is not a reader or valid buffer
49746
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
49747
+ */
49748
+ UserOperationV0_7.decode = function decode(reader, length) {
49749
+ if (!(reader instanceof $Reader))
49750
+ reader = $Reader.create(reader);
49751
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ethereum.Proto.UserOperationV0_7();
49752
+ while (reader.pos < end) {
49753
+ var tag = reader.uint32();
49754
+ switch (tag >>> 3) {
49755
+ case 1:
49756
+ message.entryPoint = reader.string();
49757
+ break;
49758
+ case 2:
49759
+ message.factory = reader.string();
49760
+ break;
49761
+ case 3:
49762
+ message.factoryData = reader.bytes();
49763
+ break;
49764
+ case 4:
49765
+ message.sender = reader.string();
49766
+ break;
49767
+ case 5:
49768
+ message.preVerificationGas = reader.bytes();
49769
+ break;
49770
+ case 6:
49771
+ message.verificationGasLimit = reader.bytes();
49772
+ break;
49773
+ case 7:
49774
+ message.paymaster = reader.string();
49775
+ break;
49776
+ case 8:
49777
+ message.paymasterVerificationGasLimit = reader.bytes();
49778
+ break;
49779
+ case 9:
49780
+ message.paymasterPostOpGasLimit = reader.bytes();
49781
+ break;
49782
+ case 10:
49783
+ message.paymasterData = reader.bytes();
49784
+ break;
49785
+ default:
49786
+ reader.skipType(tag & 7);
49787
+ break;
49788
+ }
49789
+ }
49790
+ return message;
49791
+ };
49792
+
49793
+ /**
49794
+ * Verifies a UserOperationV0_7 message.
49795
+ * @function verify
49796
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49797
+ * @static
49798
+ * @param {Object.<string,*>} message Plain object to verify
49799
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
49800
+ */
49801
+ UserOperationV0_7.verify = function verify(message) {
49802
+ if (typeof message !== "object" || message === null)
49803
+ return "object expected";
49804
+ if (message.entryPoint != null && message.hasOwnProperty("entryPoint"))
49805
+ if (!$util.isString(message.entryPoint))
49806
+ return "entryPoint: string expected";
49807
+ if (message.factory != null && message.hasOwnProperty("factory"))
49808
+ if (!$util.isString(message.factory))
49809
+ return "factory: string expected";
49810
+ if (message.factoryData != null && message.hasOwnProperty("factoryData"))
49811
+ if (!(message.factoryData && typeof message.factoryData.length === "number" || $util.isString(message.factoryData)))
49812
+ return "factoryData: buffer expected";
49813
+ if (message.sender != null && message.hasOwnProperty("sender"))
49814
+ if (!$util.isString(message.sender))
49815
+ return "sender: string expected";
49816
+ if (message.preVerificationGas != null && message.hasOwnProperty("preVerificationGas"))
49817
+ if (!(message.preVerificationGas && typeof message.preVerificationGas.length === "number" || $util.isString(message.preVerificationGas)))
49818
+ return "preVerificationGas: buffer expected";
49819
+ if (message.verificationGasLimit != null && message.hasOwnProperty("verificationGasLimit"))
49820
+ if (!(message.verificationGasLimit && typeof message.verificationGasLimit.length === "number" || $util.isString(message.verificationGasLimit)))
49821
+ return "verificationGasLimit: buffer expected";
49822
+ if (message.paymaster != null && message.hasOwnProperty("paymaster"))
49823
+ if (!$util.isString(message.paymaster))
49824
+ return "paymaster: string expected";
49825
+ if (message.paymasterVerificationGasLimit != null && message.hasOwnProperty("paymasterVerificationGasLimit"))
49826
+ if (!(message.paymasterVerificationGasLimit && typeof message.paymasterVerificationGasLimit.length === "number" || $util.isString(message.paymasterVerificationGasLimit)))
49827
+ return "paymasterVerificationGasLimit: buffer expected";
49828
+ if (message.paymasterPostOpGasLimit != null && message.hasOwnProperty("paymasterPostOpGasLimit"))
49829
+ if (!(message.paymasterPostOpGasLimit && typeof message.paymasterPostOpGasLimit.length === "number" || $util.isString(message.paymasterPostOpGasLimit)))
49830
+ return "paymasterPostOpGasLimit: buffer expected";
49831
+ if (message.paymasterData != null && message.hasOwnProperty("paymasterData"))
49832
+ if (!(message.paymasterData && typeof message.paymasterData.length === "number" || $util.isString(message.paymasterData)))
49833
+ return "paymasterData: buffer expected";
49834
+ return null;
49835
+ };
49836
+
49837
+ /**
49838
+ * Creates a UserOperationV0_7 message from a plain object. Also converts values to their respective internal types.
49839
+ * @function fromObject
49840
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49841
+ * @static
49842
+ * @param {Object.<string,*>} object Plain object
49843
+ * @returns {TW.Ethereum.Proto.UserOperationV0_7} UserOperationV0_7
49844
+ */
49845
+ UserOperationV0_7.fromObject = function fromObject(object) {
49846
+ if (object instanceof $root.TW.Ethereum.Proto.UserOperationV0_7)
49847
+ return object;
49848
+ var message = new $root.TW.Ethereum.Proto.UserOperationV0_7();
49849
+ if (object.entryPoint != null)
49850
+ message.entryPoint = String(object.entryPoint);
49851
+ if (object.factory != null)
49852
+ message.factory = String(object.factory);
49853
+ if (object.factoryData != null)
49854
+ if (typeof object.factoryData === "string")
49855
+ $util.base64.decode(object.factoryData, message.factoryData = $util.newBuffer($util.base64.length(object.factoryData)), 0);
49856
+ else if (object.factoryData.length)
49857
+ message.factoryData = object.factoryData;
49858
+ if (object.sender != null)
49859
+ message.sender = String(object.sender);
49860
+ if (object.preVerificationGas != null)
49861
+ if (typeof object.preVerificationGas === "string")
49862
+ $util.base64.decode(object.preVerificationGas, message.preVerificationGas = $util.newBuffer($util.base64.length(object.preVerificationGas)), 0);
49863
+ else if (object.preVerificationGas.length)
49864
+ message.preVerificationGas = object.preVerificationGas;
49865
+ if (object.verificationGasLimit != null)
49866
+ if (typeof object.verificationGasLimit === "string")
49867
+ $util.base64.decode(object.verificationGasLimit, message.verificationGasLimit = $util.newBuffer($util.base64.length(object.verificationGasLimit)), 0);
49868
+ else if (object.verificationGasLimit.length)
49869
+ message.verificationGasLimit = object.verificationGasLimit;
49870
+ if (object.paymaster != null)
49871
+ message.paymaster = String(object.paymaster);
49872
+ if (object.paymasterVerificationGasLimit != null)
49873
+ if (typeof object.paymasterVerificationGasLimit === "string")
49874
+ $util.base64.decode(object.paymasterVerificationGasLimit, message.paymasterVerificationGasLimit = $util.newBuffer($util.base64.length(object.paymasterVerificationGasLimit)), 0);
49875
+ else if (object.paymasterVerificationGasLimit.length)
49876
+ message.paymasterVerificationGasLimit = object.paymasterVerificationGasLimit;
49877
+ if (object.paymasterPostOpGasLimit != null)
49878
+ if (typeof object.paymasterPostOpGasLimit === "string")
49879
+ $util.base64.decode(object.paymasterPostOpGasLimit, message.paymasterPostOpGasLimit = $util.newBuffer($util.base64.length(object.paymasterPostOpGasLimit)), 0);
49880
+ else if (object.paymasterPostOpGasLimit.length)
49881
+ message.paymasterPostOpGasLimit = object.paymasterPostOpGasLimit;
49882
+ if (object.paymasterData != null)
49883
+ if (typeof object.paymasterData === "string")
49884
+ $util.base64.decode(object.paymasterData, message.paymasterData = $util.newBuffer($util.base64.length(object.paymasterData)), 0);
49885
+ else if (object.paymasterData.length)
49886
+ message.paymasterData = object.paymasterData;
49887
+ return message;
49888
+ };
49889
+
49890
+ /**
49891
+ * Creates a plain object from a UserOperationV0_7 message. Also converts values to other types if specified.
49892
+ * @function toObject
49893
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49894
+ * @static
49895
+ * @param {TW.Ethereum.Proto.UserOperationV0_7} message UserOperationV0_7
49896
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
49897
+ * @returns {Object.<string,*>} Plain object
49898
+ */
49899
+ UserOperationV0_7.toObject = function toObject(message, options) {
49900
+ if (!options)
49901
+ options = {};
49902
+ var object = {};
49903
+ if (options.defaults) {
49904
+ object.entryPoint = "";
49905
+ object.factory = "";
49906
+ if (options.bytes === String)
49907
+ object.factoryData = "";
49908
+ else {
49909
+ object.factoryData = [];
49910
+ if (options.bytes !== Array)
49911
+ object.factoryData = $util.newBuffer(object.factoryData);
49912
+ }
49913
+ object.sender = "";
49914
+ if (options.bytes === String)
49915
+ object.preVerificationGas = "";
49916
+ else {
49917
+ object.preVerificationGas = [];
49918
+ if (options.bytes !== Array)
49919
+ object.preVerificationGas = $util.newBuffer(object.preVerificationGas);
49920
+ }
49921
+ if (options.bytes === String)
49922
+ object.verificationGasLimit = "";
49923
+ else {
49924
+ object.verificationGasLimit = [];
49925
+ if (options.bytes !== Array)
49926
+ object.verificationGasLimit = $util.newBuffer(object.verificationGasLimit);
49927
+ }
49928
+ object.paymaster = "";
49929
+ if (options.bytes === String)
49930
+ object.paymasterVerificationGasLimit = "";
49931
+ else {
49932
+ object.paymasterVerificationGasLimit = [];
49933
+ if (options.bytes !== Array)
49934
+ object.paymasterVerificationGasLimit = $util.newBuffer(object.paymasterVerificationGasLimit);
49935
+ }
49936
+ if (options.bytes === String)
49937
+ object.paymasterPostOpGasLimit = "";
49938
+ else {
49939
+ object.paymasterPostOpGasLimit = [];
49940
+ if (options.bytes !== Array)
49941
+ object.paymasterPostOpGasLimit = $util.newBuffer(object.paymasterPostOpGasLimit);
49942
+ }
49943
+ if (options.bytes === String)
49944
+ object.paymasterData = "";
49945
+ else {
49946
+ object.paymasterData = [];
49947
+ if (options.bytes !== Array)
49948
+ object.paymasterData = $util.newBuffer(object.paymasterData);
49949
+ }
49950
+ }
49951
+ if (message.entryPoint != null && message.hasOwnProperty("entryPoint"))
49952
+ object.entryPoint = message.entryPoint;
49953
+ if (message.factory != null && message.hasOwnProperty("factory"))
49954
+ object.factory = message.factory;
49955
+ if (message.factoryData != null && message.hasOwnProperty("factoryData"))
49956
+ object.factoryData = options.bytes === String ? $util.base64.encode(message.factoryData, 0, message.factoryData.length) : options.bytes === Array ? Array.prototype.slice.call(message.factoryData) : message.factoryData;
49957
+ if (message.sender != null && message.hasOwnProperty("sender"))
49958
+ object.sender = message.sender;
49959
+ if (message.preVerificationGas != null && message.hasOwnProperty("preVerificationGas"))
49960
+ 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;
49961
+ if (message.verificationGasLimit != null && message.hasOwnProperty("verificationGasLimit"))
49962
+ 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;
49963
+ if (message.paymaster != null && message.hasOwnProperty("paymaster"))
49964
+ object.paymaster = message.paymaster;
49965
+ if (message.paymasterVerificationGasLimit != null && message.hasOwnProperty("paymasterVerificationGasLimit"))
49966
+ object.paymasterVerificationGasLimit = options.bytes === String ? $util.base64.encode(message.paymasterVerificationGasLimit, 0, message.paymasterVerificationGasLimit.length) : options.bytes === Array ? Array.prototype.slice.call(message.paymasterVerificationGasLimit) : message.paymasterVerificationGasLimit;
49967
+ if (message.paymasterPostOpGasLimit != null && message.hasOwnProperty("paymasterPostOpGasLimit"))
49968
+ object.paymasterPostOpGasLimit = options.bytes === String ? $util.base64.encode(message.paymasterPostOpGasLimit, 0, message.paymasterPostOpGasLimit.length) : options.bytes === Array ? Array.prototype.slice.call(message.paymasterPostOpGasLimit) : message.paymasterPostOpGasLimit;
49969
+ if (message.paymasterData != null && message.hasOwnProperty("paymasterData"))
49970
+ object.paymasterData = options.bytes === String ? $util.base64.encode(message.paymasterData, 0, message.paymasterData.length) : options.bytes === Array ? Array.prototype.slice.call(message.paymasterData) : message.paymasterData;
49971
+ return object;
49972
+ };
49973
+
49974
+ /**
49975
+ * Converts this UserOperationV0_7 to JSON.
49976
+ * @function toJSON
49977
+ * @memberof TW.Ethereum.Proto.UserOperationV0_7
49978
+ * @instance
49979
+ * @returns {Object.<string,*>} JSON object
49980
+ */
49981
+ UserOperationV0_7.prototype.toJSON = function toJSON() {
49982
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
49983
+ };
49984
+
49985
+ return UserOperationV0_7;
49986
+ })();
49987
+
49577
49988
  Proto.Access = (function() {
49578
49989
 
49579
49990
  /**
@@ -49791,6 +50202,7 @@
49791
50202
  * @property {Uint8Array|null} [privateKey] SigningInput privateKey
49792
50203
  * @property {TW.Ethereum.Proto.ITransaction|null} [transaction] SigningInput transaction
49793
50204
  * @property {TW.Ethereum.Proto.IUserOperation|null} [userOperation] SigningInput userOperation
50205
+ * @property {TW.Ethereum.Proto.IUserOperationV0_7|null} [userOperationV0_7] SigningInput userOperationV0_7
49794
50206
  * @property {Array.<TW.Ethereum.Proto.IAccess>|null} [accessList] SigningInput accessList
49795
50207
  */
49796
50208
 
@@ -49898,6 +50310,14 @@
49898
50310
  */
49899
50311
  SigningInput.prototype.userOperation = null;
49900
50312
 
50313
+ /**
50314
+ * SigningInput userOperationV0_7.
50315
+ * @member {TW.Ethereum.Proto.IUserOperationV0_7|null|undefined} userOperationV0_7
50316
+ * @memberof TW.Ethereum.Proto.SigningInput
50317
+ * @instance
50318
+ */
50319
+ SigningInput.prototype.userOperationV0_7 = null;
50320
+
49901
50321
  /**
49902
50322
  * SigningInput accessList.
49903
50323
  * @member {Array.<TW.Ethereum.Proto.IAccess>} accessList
@@ -49906,6 +50326,20 @@
49906
50326
  */
49907
50327
  SigningInput.prototype.accessList = $util.emptyArray;
49908
50328
 
50329
+ // OneOf field names bound to virtual getters and setters
50330
+ var $oneOfFields;
50331
+
50332
+ /**
50333
+ * SigningInput userOperationOneof.
50334
+ * @member {"userOperation"|"userOperationV0_7"|undefined} userOperationOneof
50335
+ * @memberof TW.Ethereum.Proto.SigningInput
50336
+ * @instance
50337
+ */
50338
+ Object.defineProperty(SigningInput.prototype, "userOperationOneof", {
50339
+ get: $util.oneOfGetter($oneOfFields = ["userOperation", "userOperationV0_7"]),
50340
+ set: $util.oneOfSetter($oneOfFields)
50341
+ });
50342
+
49909
50343
  /**
49910
50344
  * Creates a new SigningInput instance using the specified properties.
49911
50345
  * @function create
@@ -49955,6 +50389,8 @@
49955
50389
  if (message.accessList != null && message.accessList.length)
49956
50390
  for (var i = 0; i < message.accessList.length; ++i)
49957
50391
  $root.TW.Ethereum.Proto.Access.encode(message.accessList[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim();
50392
+ if (message.userOperationV0_7 != null && Object.hasOwnProperty.call(message, "userOperationV0_7"))
50393
+ $root.TW.Ethereum.Proto.UserOperationV0_7.encode(message.userOperationV0_7, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
49958
50394
  return writer;
49959
50395
  };
49960
50396
 
@@ -50009,6 +50445,9 @@
50009
50445
  case 11:
50010
50446
  message.userOperation = $root.TW.Ethereum.Proto.UserOperation.decode(reader, reader.uint32());
50011
50447
  break;
50448
+ case 13:
50449
+ message.userOperationV0_7 = $root.TW.Ethereum.Proto.UserOperationV0_7.decode(reader, reader.uint32());
50450
+ break;
50012
50451
  case 12:
50013
50452
  if (!(message.accessList && message.accessList.length))
50014
50453
  message.accessList = [];
@@ -50033,6 +50472,7 @@
50033
50472
  SigningInput.verify = function verify(message) {
50034
50473
  if (typeof message !== "object" || message === null)
50035
50474
  return "object expected";
50475
+ var properties = {};
50036
50476
  if (message.chainId != null && message.hasOwnProperty("chainId"))
50037
50477
  if (!(message.chainId && typeof message.chainId.length === "number" || $util.isString(message.chainId)))
50038
50478
  return "chainId: buffer expected";
@@ -50072,9 +50512,22 @@
50072
50512
  return "transaction." + error;
50073
50513
  }
50074
50514
  if (message.userOperation != null && message.hasOwnProperty("userOperation")) {
50075
- var error = $root.TW.Ethereum.Proto.UserOperation.verify(message.userOperation);
50076
- if (error)
50077
- return "userOperation." + error;
50515
+ properties.userOperationOneof = 1;
50516
+ {
50517
+ var error = $root.TW.Ethereum.Proto.UserOperation.verify(message.userOperation);
50518
+ if (error)
50519
+ return "userOperation." + error;
50520
+ }
50521
+ }
50522
+ if (message.userOperationV0_7 != null && message.hasOwnProperty("userOperationV0_7")) {
50523
+ if (properties.userOperationOneof === 1)
50524
+ return "userOperationOneof: multiple values";
50525
+ properties.userOperationOneof = 1;
50526
+ {
50527
+ var error = $root.TW.Ethereum.Proto.UserOperationV0_7.verify(message.userOperationV0_7);
50528
+ if (error)
50529
+ return "userOperationV0_7." + error;
50530
+ }
50078
50531
  }
50079
50532
  if (message.accessList != null && message.hasOwnProperty("accessList")) {
50080
50533
  if (!Array.isArray(message.accessList))
@@ -50161,6 +50614,11 @@
50161
50614
  throw TypeError(".TW.Ethereum.Proto.SigningInput.userOperation: object expected");
50162
50615
  message.userOperation = $root.TW.Ethereum.Proto.UserOperation.fromObject(object.userOperation);
50163
50616
  }
50617
+ if (object.userOperationV0_7 != null) {
50618
+ if (typeof object.userOperationV0_7 !== "object")
50619
+ throw TypeError(".TW.Ethereum.Proto.SigningInput.userOperationV0_7: object expected");
50620
+ message.userOperationV0_7 = $root.TW.Ethereum.Proto.UserOperationV0_7.fromObject(object.userOperationV0_7);
50621
+ }
50164
50622
  if (object.accessList) {
50165
50623
  if (!Array.isArray(object.accessList))
50166
50624
  throw TypeError(".TW.Ethereum.Proto.SigningInput.accessList: array expected");
@@ -50242,7 +50700,6 @@
50242
50700
  object.privateKey = $util.newBuffer(object.privateKey);
50243
50701
  }
50244
50702
  object.transaction = null;
50245
- object.userOperation = null;
50246
50703
  }
50247
50704
  if (message.chainId != null && message.hasOwnProperty("chainId"))
50248
50705
  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;
@@ -50264,13 +50721,21 @@
50264
50721
  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;
50265
50722
  if (message.transaction != null && message.hasOwnProperty("transaction"))
50266
50723
  object.transaction = $root.TW.Ethereum.Proto.Transaction.toObject(message.transaction, options);
50267
- if (message.userOperation != null && message.hasOwnProperty("userOperation"))
50724
+ if (message.userOperation != null && message.hasOwnProperty("userOperation")) {
50268
50725
  object.userOperation = $root.TW.Ethereum.Proto.UserOperation.toObject(message.userOperation, options);
50726
+ if (options.oneofs)
50727
+ object.userOperationOneof = "userOperation";
50728
+ }
50269
50729
  if (message.accessList && message.accessList.length) {
50270
50730
  object.accessList = [];
50271
50731
  for (var j = 0; j < message.accessList.length; ++j)
50272
50732
  object.accessList[j] = $root.TW.Ethereum.Proto.Access.toObject(message.accessList[j], options);
50273
50733
  }
50734
+ if (message.userOperationV0_7 != null && message.hasOwnProperty("userOperationV0_7")) {
50735
+ object.userOperationV0_7 = $root.TW.Ethereum.Proto.UserOperationV0_7.toObject(message.userOperationV0_7, options);
50736
+ if (options.oneofs)
50737
+ object.userOperationOneof = "userOperationV0_7";
50738
+ }
50274
50739
  return object;
50275
50740
  };
50276
50741
 
@@ -36,7 +36,7 @@ function $a(a,b){var c=M;return sa||"function"!=typeof WebAssembly.instantiateSt
36
36
  function z(a,b){Object.getOwnPropertyDescriptor(g,a)||Object.defineProperty(g,a,{configurable:!0,get:function(){n("Module."+a+" has been replaced with plain "+b+" (the initial value can be provided on Module, but after startup the value is only looked for on a local variable of that name)")}})}
37
37
  function cb(a){return"FS_createPath"===a||"FS_createDataFile"===a||"FS_createPreloadedFile"===a||"FS_unlink"===a||"addRunDependency"===a||"FS_createLazyFile"===a||"FS_createDevice"===a||"removeRunDependency"===a}(function(a,b){"undefined"!==typeof globalThis&&Object.defineProperty(globalThis,a,{configurable:!0,get:function(){ya("`"+a+"` is not longer defined by emscripten. "+b)}})})("buffer","Please use HEAP8.buffer or wasmMemory.buffer");
38
38
  function db(a){Object.getOwnPropertyDescriptor(g,a)||Object.defineProperty(g,a,{configurable:!0,get:function(){var b="'"+a+"' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the FAQ)";cb(a)&&(b+=". Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you");n(b)}})}
39
- var eb={2164884:()=>{if(void 0===g.fa)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.fa=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.fa=a}catch(e){throw"No secure random number generator found";}}},2165606:()=>g.fa()};
39
+ var eb={2166292:()=>{if(void 0===g.fa)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.fa=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.fa=a}catch(e){throw"No secure random number generator found";}}},2167014:()=>g.fa()};
40
40
  function qa(a){this.name="ExitStatus";this.message="Program terminated with exit("+a+")";this.status=a}function fb(a){for(;0<a.length;)a.shift()(g)}function za(a){assert("number"===typeof a);return"0x"+a.toString(16).padStart(8,"0")}function ya(a){gb||(gb={});gb[a]||(gb[a]=1,w&&(a="warning: "+a),y(a))}var gb,hb=[];function ib(a){var b=hb[a];b||(a>=hb.length&&(hb.length=a+1),hb[a]=b=Ha.get(a));assert(Ha.get(a)==b,"JavaScript-side Wasm function table mirror is out of date!");return b}
41
41
  function jb(a){this.l=a-24;this.Oa=function(b){G[this.l+4>>2]=b};this.Ja=function(b){G[this.l+8>>2]=b};this.Ka=function(){F[this.l>>2]=0};this.Ea=function(){D[this.l+12>>0]=0};this.La=function(){D[this.l+13>>0]=0};this.I=function(b,c){this.Da();this.Oa(b);this.Ja(c);this.Ka();this.Ea();this.La()};this.Da=function(){G[this.l+16>>2]=0}}
42
42
  var kb=0,lb=(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},mb=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=lb(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},nb=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},ob=
Binary file
@@ -96,6 +96,10 @@ export class Barz {
96
96
  static getFormattedSignature(signature: Uint8Array | Buffer, challenge: Uint8Array | Buffer, authenticatorData: Uint8Array | Buffer, clientDataJSON: string): Uint8Array;
97
97
  static getPrefixedMsgHash(msgHash: Uint8Array | Buffer, barzAddress: string, chainId: number): Uint8Array;
98
98
  static getDiamondCutCode(input: Uint8Array | Buffer): Uint8Array;
99
+ static getAuthorizationHash(chainId: Uint8Array | Buffer, contractAddress: string, nonce: Uint8Array | Buffer): Uint8Array;
100
+ static signAuthorization(chainId: Uint8Array | Buffer, contractAddress: string, nonce: Uint8Array | Buffer, privateKey: string): string;
101
+ static getEncodedHash(chainId: Uint8Array | Buffer, wallet: string, version: string, typeHash: string, domainSeparatorHash: string, hash: string): Uint8Array;
102
+ static getSignedHash(hash: string, privateKey: string): Uint8Array;
99
103
  }
100
104
  export class Base32 {
101
105
  static decodeWithAlphabet(string: string, alphabet: string): Uint8Array;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustwallet/wallet-core",
3
- "version": "4.2.14",
3
+ "version": "4.2.16-rc1",
4
4
  "description": "wallet core wasm and protobuf models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",