@trustwallet/wallet-core 4.2.17 → 4.2.19

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.
@@ -16597,7 +16597,8 @@ export namespace TW {
16597
16597
  enum TransactionMode {
16598
16598
  Legacy = 0,
16599
16599
  Enveloped = 1,
16600
- UserOp = 2
16600
+ UserOp = 2,
16601
+ SetCode = 4
16601
16602
  }
16602
16603
 
16603
16604
  /** Properties of a UserOperation. */
@@ -16909,10 +16910,84 @@ export namespace TW {
16909
16910
  public toJSON(): { [k: string]: any };
16910
16911
  }
16911
16912
 
16913
+ /** Properties of an Authority. */
16914
+ interface IAuthority {
16915
+
16916
+ /** Authority address */
16917
+ address?: (string|null);
16918
+ }
16919
+
16920
+ /** Represents an Authority. */
16921
+ class Authority implements IAuthority {
16922
+
16923
+ /**
16924
+ * Constructs a new Authority.
16925
+ * @param [properties] Properties to set
16926
+ */
16927
+ constructor(properties?: TW.Ethereum.Proto.IAuthority);
16928
+
16929
+ /** Authority address. */
16930
+ public address: string;
16931
+
16932
+ /**
16933
+ * Creates a new Authority instance using the specified properties.
16934
+ * @param [properties] Properties to set
16935
+ * @returns Authority instance
16936
+ */
16937
+ public static create(properties?: TW.Ethereum.Proto.IAuthority): TW.Ethereum.Proto.Authority;
16938
+
16939
+ /**
16940
+ * Encodes the specified Authority message. Does not implicitly {@link TW.Ethereum.Proto.Authority.verify|verify} messages.
16941
+ * @param message Authority message or plain object to encode
16942
+ * @param [writer] Writer to encode to
16943
+ * @returns Writer
16944
+ */
16945
+ public static encode(message: TW.Ethereum.Proto.IAuthority, writer?: $protobuf.Writer): $protobuf.Writer;
16946
+
16947
+ /**
16948
+ * Decodes an Authority message from the specified reader or buffer.
16949
+ * @param reader Reader or buffer to decode from
16950
+ * @param [length] Message length if known beforehand
16951
+ * @returns Authority
16952
+ * @throws {Error} If the payload is not a reader or valid buffer
16953
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
16954
+ */
16955
+ public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): TW.Ethereum.Proto.Authority;
16956
+
16957
+ /**
16958
+ * Verifies an Authority message.
16959
+ * @param message Plain object to verify
16960
+ * @returns `null` if valid, otherwise the reason why it is not
16961
+ */
16962
+ public static verify(message: { [k: string]: any }): (string|null);
16963
+
16964
+ /**
16965
+ * Creates an Authority message from a plain object. Also converts values to their respective internal types.
16966
+ * @param object Plain object
16967
+ * @returns Authority
16968
+ */
16969
+ public static fromObject(object: { [k: string]: any }): TW.Ethereum.Proto.Authority;
16970
+
16971
+ /**
16972
+ * Creates a plain object from an Authority message. Also converts values to other types if specified.
16973
+ * @param message Authority
16974
+ * @param [options] Conversion options
16975
+ * @returns Plain object
16976
+ */
16977
+ public static toObject(message: TW.Ethereum.Proto.Authority, options?: $protobuf.IConversionOptions): { [k: string]: any };
16978
+
16979
+ /**
16980
+ * Converts this Authority to JSON.
16981
+ * @returns JSON object
16982
+ */
16983
+ public toJSON(): { [k: string]: any };
16984
+ }
16985
+
16912
16986
  /** SCAccountType enum. */
16913
16987
  enum SCAccountType {
16914
16988
  SimpleAccount = 0,
16915
- Biz4337 = 1
16989
+ Biz4337 = 1,
16990
+ Biz = 2
16916
16991
  }
16917
16992
 
16918
16993
  /** Properties of a SigningInput. */
@@ -16959,6 +17034,9 @@ export namespace TW {
16959
17034
 
16960
17035
  /** SigningInput userOperationMode */
16961
17036
  userOperationMode?: (TW.Ethereum.Proto.SCAccountType|null);
17037
+
17038
+ /** SigningInput eip7702Authority */
17039
+ eip7702Authority?: (TW.Ethereum.Proto.IAuthority|null);
16962
17040
  }
16963
17041
 
16964
17042
  /** Represents a SigningInput. */
@@ -17012,6 +17090,9 @@ export namespace TW {
17012
17090
  /** SigningInput userOperationMode. */
17013
17091
  public userOperationMode: TW.Ethereum.Proto.SCAccountType;
17014
17092
 
17093
+ /** SigningInput eip7702Authority. */
17094
+ public eip7702Authority?: (TW.Ethereum.Proto.IAuthority|null);
17095
+
17015
17096
  /** SigningInput userOperationOneof. */
17016
17097
  public userOperationOneof?: ("userOperation"|"userOperationV0_7");
17017
17098
 
@@ -49260,12 +49260,14 @@
49260
49260
  * @property {number} Legacy=0 Legacy value
49261
49261
  * @property {number} Enveloped=1 Enveloped value
49262
49262
  * @property {number} UserOp=2 UserOp value
49263
+ * @property {number} SetCode=4 SetCode value
49263
49264
  */
49264
49265
  Proto.TransactionMode = (function() {
49265
49266
  var valuesById = {}, values = Object.create(valuesById);
49266
49267
  values[valuesById[0] = "Legacy"] = 0;
49267
49268
  values[valuesById[1] = "Enveloped"] = 1;
49268
49269
  values[valuesById[2] = "UserOp"] = 2;
49270
+ values[valuesById[4] = "SetCode"] = 4;
49269
49271
  return values;
49270
49272
  })();
49271
49273
 
@@ -50185,17 +50187,177 @@
50185
50187
  return Access;
50186
50188
  })();
50187
50189
 
50190
+ Proto.Authority = (function() {
50191
+
50192
+ /**
50193
+ * Properties of an Authority.
50194
+ * @memberof TW.Ethereum.Proto
50195
+ * @interface IAuthority
50196
+ * @property {string|null} [address] Authority address
50197
+ */
50198
+
50199
+ /**
50200
+ * Constructs a new Authority.
50201
+ * @memberof TW.Ethereum.Proto
50202
+ * @classdesc Represents an Authority.
50203
+ * @implements IAuthority
50204
+ * @constructor
50205
+ * @param {TW.Ethereum.Proto.IAuthority=} [properties] Properties to set
50206
+ */
50207
+ function Authority(properties) {
50208
+ if (properties)
50209
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
50210
+ if (properties[keys[i]] != null)
50211
+ this[keys[i]] = properties[keys[i]];
50212
+ }
50213
+
50214
+ /**
50215
+ * Authority address.
50216
+ * @member {string} address
50217
+ * @memberof TW.Ethereum.Proto.Authority
50218
+ * @instance
50219
+ */
50220
+ Authority.prototype.address = "";
50221
+
50222
+ /**
50223
+ * Creates a new Authority instance using the specified properties.
50224
+ * @function create
50225
+ * @memberof TW.Ethereum.Proto.Authority
50226
+ * @static
50227
+ * @param {TW.Ethereum.Proto.IAuthority=} [properties] Properties to set
50228
+ * @returns {TW.Ethereum.Proto.Authority} Authority instance
50229
+ */
50230
+ Authority.create = function create(properties) {
50231
+ return new Authority(properties);
50232
+ };
50233
+
50234
+ /**
50235
+ * Encodes the specified Authority message. Does not implicitly {@link TW.Ethereum.Proto.Authority.verify|verify} messages.
50236
+ * @function encode
50237
+ * @memberof TW.Ethereum.Proto.Authority
50238
+ * @static
50239
+ * @param {TW.Ethereum.Proto.IAuthority} message Authority message or plain object to encode
50240
+ * @param {$protobuf.Writer} [writer] Writer to encode to
50241
+ * @returns {$protobuf.Writer} Writer
50242
+ */
50243
+ Authority.encode = function encode(message, writer) {
50244
+ if (!writer)
50245
+ writer = $Writer.create();
50246
+ if (message.address != null && Object.hasOwnProperty.call(message, "address"))
50247
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.address);
50248
+ return writer;
50249
+ };
50250
+
50251
+ /**
50252
+ * Decodes an Authority message from the specified reader or buffer.
50253
+ * @function decode
50254
+ * @memberof TW.Ethereum.Proto.Authority
50255
+ * @static
50256
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
50257
+ * @param {number} [length] Message length if known beforehand
50258
+ * @returns {TW.Ethereum.Proto.Authority} Authority
50259
+ * @throws {Error} If the payload is not a reader or valid buffer
50260
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
50261
+ */
50262
+ Authority.decode = function decode(reader, length) {
50263
+ if (!(reader instanceof $Reader))
50264
+ reader = $Reader.create(reader);
50265
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ethereum.Proto.Authority();
50266
+ while (reader.pos < end) {
50267
+ var tag = reader.uint32();
50268
+ switch (tag >>> 3) {
50269
+ case 2:
50270
+ message.address = reader.string();
50271
+ break;
50272
+ default:
50273
+ reader.skipType(tag & 7);
50274
+ break;
50275
+ }
50276
+ }
50277
+ return message;
50278
+ };
50279
+
50280
+ /**
50281
+ * Verifies an Authority message.
50282
+ * @function verify
50283
+ * @memberof TW.Ethereum.Proto.Authority
50284
+ * @static
50285
+ * @param {Object.<string,*>} message Plain object to verify
50286
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
50287
+ */
50288
+ Authority.verify = function verify(message) {
50289
+ if (typeof message !== "object" || message === null)
50290
+ return "object expected";
50291
+ if (message.address != null && message.hasOwnProperty("address"))
50292
+ if (!$util.isString(message.address))
50293
+ return "address: string expected";
50294
+ return null;
50295
+ };
50296
+
50297
+ /**
50298
+ * Creates an Authority message from a plain object. Also converts values to their respective internal types.
50299
+ * @function fromObject
50300
+ * @memberof TW.Ethereum.Proto.Authority
50301
+ * @static
50302
+ * @param {Object.<string,*>} object Plain object
50303
+ * @returns {TW.Ethereum.Proto.Authority} Authority
50304
+ */
50305
+ Authority.fromObject = function fromObject(object) {
50306
+ if (object instanceof $root.TW.Ethereum.Proto.Authority)
50307
+ return object;
50308
+ var message = new $root.TW.Ethereum.Proto.Authority();
50309
+ if (object.address != null)
50310
+ message.address = String(object.address);
50311
+ return message;
50312
+ };
50313
+
50314
+ /**
50315
+ * Creates a plain object from an Authority message. Also converts values to other types if specified.
50316
+ * @function toObject
50317
+ * @memberof TW.Ethereum.Proto.Authority
50318
+ * @static
50319
+ * @param {TW.Ethereum.Proto.Authority} message Authority
50320
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
50321
+ * @returns {Object.<string,*>} Plain object
50322
+ */
50323
+ Authority.toObject = function toObject(message, options) {
50324
+ if (!options)
50325
+ options = {};
50326
+ var object = {};
50327
+ if (options.defaults)
50328
+ object.address = "";
50329
+ if (message.address != null && message.hasOwnProperty("address"))
50330
+ object.address = message.address;
50331
+ return object;
50332
+ };
50333
+
50334
+ /**
50335
+ * Converts this Authority to JSON.
50336
+ * @function toJSON
50337
+ * @memberof TW.Ethereum.Proto.Authority
50338
+ * @instance
50339
+ * @returns {Object.<string,*>} JSON object
50340
+ */
50341
+ Authority.prototype.toJSON = function toJSON() {
50342
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
50343
+ };
50344
+
50345
+ return Authority;
50346
+ })();
50347
+
50188
50348
  /**
50189
50349
  * SCAccountType enum.
50190
50350
  * @name TW.Ethereum.Proto.SCAccountType
50191
50351
  * @enum {number}
50192
50352
  * @property {number} SimpleAccount=0 SimpleAccount value
50193
50353
  * @property {number} Biz4337=1 Biz4337 value
50354
+ * @property {number} Biz=2 Biz value
50194
50355
  */
50195
50356
  Proto.SCAccountType = (function() {
50196
50357
  var valuesById = {}, values = Object.create(valuesById);
50197
50358
  values[valuesById[0] = "SimpleAccount"] = 0;
50198
50359
  values[valuesById[1] = "Biz4337"] = 1;
50360
+ values[valuesById[2] = "Biz"] = 2;
50199
50361
  return values;
50200
50362
  })();
50201
50363
 
@@ -50219,6 +50381,7 @@
50219
50381
  * @property {TW.Ethereum.Proto.IUserOperationV0_7|null} [userOperationV0_7] SigningInput userOperationV0_7
50220
50382
  * @property {Array.<TW.Ethereum.Proto.IAccess>|null} [accessList] SigningInput accessList
50221
50383
  * @property {TW.Ethereum.Proto.SCAccountType|null} [userOperationMode] SigningInput userOperationMode
50384
+ * @property {TW.Ethereum.Proto.IAuthority|null} [eip7702Authority] SigningInput eip7702Authority
50222
50385
  */
50223
50386
 
50224
50387
  /**
@@ -50349,6 +50512,14 @@
50349
50512
  */
50350
50513
  SigningInput.prototype.userOperationMode = 0;
50351
50514
 
50515
+ /**
50516
+ * SigningInput eip7702Authority.
50517
+ * @member {TW.Ethereum.Proto.IAuthority|null|undefined} eip7702Authority
50518
+ * @memberof TW.Ethereum.Proto.SigningInput
50519
+ * @instance
50520
+ */
50521
+ SigningInput.prototype.eip7702Authority = null;
50522
+
50352
50523
  // OneOf field names bound to virtual getters and setters
50353
50524
  var $oneOfFields;
50354
50525
 
@@ -50416,6 +50587,8 @@
50416
50587
  $root.TW.Ethereum.Proto.UserOperationV0_7.encode(message.userOperationV0_7, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
50417
50588
  if (message.userOperationMode != null && Object.hasOwnProperty.call(message, "userOperationMode"))
50418
50589
  writer.uint32(/* id 14, wireType 0 =*/112).int32(message.userOperationMode);
50590
+ if (message.eip7702Authority != null && Object.hasOwnProperty.call(message, "eip7702Authority"))
50591
+ $root.TW.Ethereum.Proto.Authority.encode(message.eip7702Authority, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim();
50419
50592
  return writer;
50420
50593
  };
50421
50594
 
@@ -50481,6 +50654,9 @@
50481
50654
  case 14:
50482
50655
  message.userOperationMode = reader.int32();
50483
50656
  break;
50657
+ case 15:
50658
+ message.eip7702Authority = $root.TW.Ethereum.Proto.Authority.decode(reader, reader.uint32());
50659
+ break;
50484
50660
  default:
50485
50661
  reader.skipType(tag & 7);
50486
50662
  break;
@@ -50514,6 +50690,7 @@
50514
50690
  case 0:
50515
50691
  case 1:
50516
50692
  case 2:
50693
+ case 4:
50517
50694
  break;
50518
50695
  }
50519
50696
  if (message.gasPrice != null && message.hasOwnProperty("gasPrice"))
@@ -50572,8 +50749,14 @@
50572
50749
  return "userOperationMode: enum value expected";
50573
50750
  case 0:
50574
50751
  case 1:
50752
+ case 2:
50575
50753
  break;
50576
50754
  }
50755
+ if (message.eip7702Authority != null && message.hasOwnProperty("eip7702Authority")) {
50756
+ var error = $root.TW.Ethereum.Proto.Authority.verify(message.eip7702Authority);
50757
+ if (error)
50758
+ return "eip7702Authority." + error;
50759
+ }
50577
50760
  return null;
50578
50761
  };
50579
50762
 
@@ -50612,6 +50795,10 @@
50612
50795
  case 2:
50613
50796
  message.txMode = 2;
50614
50797
  break;
50798
+ case "SetCode":
50799
+ case 4:
50800
+ message.txMode = 4;
50801
+ break;
50615
50802
  }
50616
50803
  if (object.gasPrice != null)
50617
50804
  if (typeof object.gasPrice === "string")
@@ -50674,6 +50861,15 @@
50674
50861
  case 1:
50675
50862
  message.userOperationMode = 1;
50676
50863
  break;
50864
+ case "Biz":
50865
+ case 2:
50866
+ message.userOperationMode = 2;
50867
+ break;
50868
+ }
50869
+ if (object.eip7702Authority != null) {
50870
+ if (typeof object.eip7702Authority !== "object")
50871
+ throw TypeError(".TW.Ethereum.Proto.SigningInput.eip7702Authority: object expected");
50872
+ message.eip7702Authority = $root.TW.Ethereum.Proto.Authority.fromObject(object.eip7702Authority);
50677
50873
  }
50678
50874
  return message;
50679
50875
  };
@@ -50747,6 +50943,7 @@
50747
50943
  }
50748
50944
  object.transaction = null;
50749
50945
  object.userOperationMode = options.enums === String ? "SimpleAccount" : 0;
50946
+ object.eip7702Authority = null;
50750
50947
  }
50751
50948
  if (message.chainId != null && message.hasOwnProperty("chainId"))
50752
50949
  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;
@@ -50785,6 +50982,8 @@
50785
50982
  }
50786
50983
  if (message.userOperationMode != null && message.hasOwnProperty("userOperationMode"))
50787
50984
  object.userOperationMode = options.enums === String ? $root.TW.Ethereum.Proto.SCAccountType[message.userOperationMode] : message.userOperationMode;
50985
+ if (message.eip7702Authority != null && message.hasOwnProperty("eip7702Authority"))
50986
+ object.eip7702Authority = $root.TW.Ethereum.Proto.Authority.toObject(message.eip7702Authority, options);
50788
50987
  return object;
50789
50988
  };
50790
50989
 
@@ -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={2180436:()=>{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";}}},2181158:()=>g.fa()};
39
+ var eb={2181140:()=>{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";}}},2181862:()=>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
@@ -98,7 +98,7 @@ export class Barz {
98
98
  static getDiamondCutCode(input: Uint8Array | Buffer): Uint8Array;
99
99
  static getAuthorizationHash(chainId: Uint8Array | Buffer, contractAddress: string, nonce: Uint8Array | Buffer): Uint8Array;
100
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;
101
+ static getEncodedHash(chainId: Uint8Array | Buffer, codeAddress: string, codeName: string, codeVersion: string, typeHash: string, domainSeparatorHash: string, sender: string, userOpHash: string): Uint8Array;
102
102
  static getSignedHash(hash: string, privateKey: string): Uint8Array;
103
103
  }
104
104
  export class Base32 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustwallet/wallet-core",
3
- "version": "4.2.17",
3
+ "version": "4.2.19",
4
4
  "description": "wallet core wasm and protobuf models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",