@trustwallet/wallet-core 3.1.21 → 3.1.23

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.
@@ -784,6 +784,9 @@ export namespace TW {
784
784
 
785
785
  /** SigningOutput encoded */
786
786
  encoded?: (Uint8Array|null);
787
+
788
+ /** SigningOutput signature */
789
+ signature?: (string|null);
787
790
  }
788
791
 
789
792
  /** Represents a SigningOutput. */
@@ -798,6 +801,9 @@ export namespace TW {
798
801
  /** SigningOutput encoded. */
799
802
  public encoded: Uint8Array;
800
803
 
804
+ /** SigningOutput signature. */
805
+ public signature: string;
806
+
801
807
  /**
802
808
  * Creates a new SigningOutput instance using the specified properties.
803
809
  * @param [properties] Properties to set
@@ -11046,6 +11052,12 @@ export namespace TW {
11046
11052
  /** Namespace Proto. */
11047
11053
  namespace Proto {
11048
11054
 
11055
+ /** DerivationType enum. */
11056
+ enum DerivationType {
11057
+ SECP256K1 = 0,
11058
+ DELEGATED = 1
11059
+ }
11060
+
11049
11061
  /** Properties of a SigningInput. */
11050
11062
  interface ISigningInput {
11051
11063
 
@@ -11069,6 +11081,12 @@ export namespace TW {
11069
11081
 
11070
11082
  /** SigningInput gasPremium */
11071
11083
  gasPremium?: (Uint8Array|null);
11084
+
11085
+ /** SigningInput params */
11086
+ params?: (Uint8Array|null);
11087
+
11088
+ /** SigningInput derivation */
11089
+ derivation?: (TW.Filecoin.Proto.DerivationType|null);
11072
11090
  }
11073
11091
 
11074
11092
  /** Represents a SigningInput. */
@@ -11101,6 +11119,12 @@ export namespace TW {
11101
11119
  /** SigningInput gasPremium. */
11102
11120
  public gasPremium: Uint8Array;
11103
11121
 
11122
+ /** SigningInput params. */
11123
+ public params: Uint8Array;
11124
+
11125
+ /** SigningInput derivation. */
11126
+ public derivation: TW.Filecoin.Proto.DerivationType;
11127
+
11104
11128
  /**
11105
11129
  * Creates a new SigningInput instance using the specified properties.
11106
11130
  * @param [properties] Properties to set
@@ -11160,6 +11184,9 @@ export namespace TW {
11160
11184
 
11161
11185
  /** SigningOutput json */
11162
11186
  json?: (string|null);
11187
+
11188
+ /** SigningOutput errorMessage */
11189
+ errorMessage?: (string|null);
11163
11190
  }
11164
11191
 
11165
11192
  /** Represents a SigningOutput. */
@@ -11174,6 +11201,9 @@ export namespace TW {
11174
11201
  /** SigningOutput json. */
11175
11202
  public json: string;
11176
11203
 
11204
+ /** SigningOutput errorMessage. */
11205
+ public errorMessage: string;
11206
+
11177
11207
  /**
11178
11208
  * Creates a new SigningOutput instance using the specified properties.
11179
11209
  * @param [properties] Properties to set
@@ -2300,6 +2300,7 @@
2300
2300
  * @memberof TW.Algorand.Proto
2301
2301
  * @interface ISigningOutput
2302
2302
  * @property {Uint8Array|null} [encoded] SigningOutput encoded
2303
+ * @property {string|null} [signature] SigningOutput signature
2303
2304
  */
2304
2305
 
2305
2306
  /**
@@ -2325,6 +2326,14 @@
2325
2326
  */
2326
2327
  SigningOutput.prototype.encoded = $util.newBuffer([]);
2327
2328
 
2329
+ /**
2330
+ * SigningOutput signature.
2331
+ * @member {string} signature
2332
+ * @memberof TW.Algorand.Proto.SigningOutput
2333
+ * @instance
2334
+ */
2335
+ SigningOutput.prototype.signature = "";
2336
+
2328
2337
  /**
2329
2338
  * Creates a new SigningOutput instance using the specified properties.
2330
2339
  * @function create
@@ -2351,6 +2360,8 @@
2351
2360
  writer = $Writer.create();
2352
2361
  if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded"))
2353
2362
  writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.encoded);
2363
+ if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
2364
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.signature);
2354
2365
  return writer;
2355
2366
  };
2356
2367
 
@@ -2375,6 +2386,9 @@
2375
2386
  case 1:
2376
2387
  message.encoded = reader.bytes();
2377
2388
  break;
2389
+ case 2:
2390
+ message.signature = reader.string();
2391
+ break;
2378
2392
  default:
2379
2393
  reader.skipType(tag & 7);
2380
2394
  break;
@@ -2397,6 +2411,9 @@
2397
2411
  if (message.encoded != null && message.hasOwnProperty("encoded"))
2398
2412
  if (!(message.encoded && typeof message.encoded.length === "number" || $util.isString(message.encoded)))
2399
2413
  return "encoded: buffer expected";
2414
+ if (message.signature != null && message.hasOwnProperty("signature"))
2415
+ if (!$util.isString(message.signature))
2416
+ return "signature: string expected";
2400
2417
  return null;
2401
2418
  };
2402
2419
 
@@ -2417,6 +2434,8 @@
2417
2434
  $util.base64.decode(object.encoded, message.encoded = $util.newBuffer($util.base64.length(object.encoded)), 0);
2418
2435
  else if (object.encoded.length)
2419
2436
  message.encoded = object.encoded;
2437
+ if (object.signature != null)
2438
+ message.signature = String(object.signature);
2420
2439
  return message;
2421
2440
  };
2422
2441
 
@@ -2433,7 +2452,7 @@
2433
2452
  if (!options)
2434
2453
  options = {};
2435
2454
  var object = {};
2436
- if (options.defaults)
2455
+ if (options.defaults) {
2437
2456
  if (options.bytes === String)
2438
2457
  object.encoded = "";
2439
2458
  else {
@@ -2441,8 +2460,12 @@
2441
2460
  if (options.bytes !== Array)
2442
2461
  object.encoded = $util.newBuffer(object.encoded);
2443
2462
  }
2463
+ object.signature = "";
2464
+ }
2444
2465
  if (message.encoded != null && message.hasOwnProperty("encoded"))
2445
2466
  object.encoded = options.bytes === String ? $util.base64.encode(message.encoded, 0, message.encoded.length) : options.bytes === Array ? Array.prototype.slice.call(message.encoded) : message.encoded;
2467
+ if (message.signature != null && message.hasOwnProperty("signature"))
2468
+ object.signature = message.signature;
2446
2469
  return object;
2447
2470
  };
2448
2471
 
@@ -32720,6 +32743,20 @@
32720
32743
  */
32721
32744
  var Proto = {};
32722
32745
 
32746
+ /**
32747
+ * DerivationType enum.
32748
+ * @name TW.Filecoin.Proto.DerivationType
32749
+ * @enum {number}
32750
+ * @property {number} SECP256K1=0 SECP256K1 value
32751
+ * @property {number} DELEGATED=1 DELEGATED value
32752
+ */
32753
+ Proto.DerivationType = (function() {
32754
+ var valuesById = {}, values = Object.create(valuesById);
32755
+ values[valuesById[0] = "SECP256K1"] = 0;
32756
+ values[valuesById[1] = "DELEGATED"] = 1;
32757
+ return values;
32758
+ })();
32759
+
32723
32760
  Proto.SigningInput = (function() {
32724
32761
 
32725
32762
  /**
@@ -32733,6 +32770,8 @@
32733
32770
  * @property {Long|null} [gasLimit] SigningInput gasLimit
32734
32771
  * @property {Uint8Array|null} [gasFeeCap] SigningInput gasFeeCap
32735
32772
  * @property {Uint8Array|null} [gasPremium] SigningInput gasPremium
32773
+ * @property {Uint8Array|null} [params] SigningInput params
32774
+ * @property {TW.Filecoin.Proto.DerivationType|null} [derivation] SigningInput derivation
32736
32775
  */
32737
32776
 
32738
32777
  /**
@@ -32806,6 +32845,22 @@
32806
32845
  */
32807
32846
  SigningInput.prototype.gasPremium = $util.newBuffer([]);
32808
32847
 
32848
+ /**
32849
+ * SigningInput params.
32850
+ * @member {Uint8Array} params
32851
+ * @memberof TW.Filecoin.Proto.SigningInput
32852
+ * @instance
32853
+ */
32854
+ SigningInput.prototype.params = $util.newBuffer([]);
32855
+
32856
+ /**
32857
+ * SigningInput derivation.
32858
+ * @member {TW.Filecoin.Proto.DerivationType} derivation
32859
+ * @memberof TW.Filecoin.Proto.SigningInput
32860
+ * @instance
32861
+ */
32862
+ SigningInput.prototype.derivation = 0;
32863
+
32809
32864
  /**
32810
32865
  * Creates a new SigningInput instance using the specified properties.
32811
32866
  * @function create
@@ -32844,6 +32899,10 @@
32844
32899
  writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.gasFeeCap);
32845
32900
  if (message.gasPremium != null && Object.hasOwnProperty.call(message, "gasPremium"))
32846
32901
  writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.gasPremium);
32902
+ if (message.params != null && Object.hasOwnProperty.call(message, "params"))
32903
+ writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.params);
32904
+ if (message.derivation != null && Object.hasOwnProperty.call(message, "derivation"))
32905
+ writer.uint32(/* id 9, wireType 0 =*/72).int32(message.derivation);
32847
32906
  return writer;
32848
32907
  };
32849
32908
 
@@ -32886,6 +32945,12 @@
32886
32945
  case 7:
32887
32946
  message.gasPremium = reader.bytes();
32888
32947
  break;
32948
+ case 8:
32949
+ message.params = reader.bytes();
32950
+ break;
32951
+ case 9:
32952
+ message.derivation = reader.int32();
32953
+ break;
32889
32954
  default:
32890
32955
  reader.skipType(tag & 7);
32891
32956
  break;
@@ -32926,6 +32991,17 @@
32926
32991
  if (message.gasPremium != null && message.hasOwnProperty("gasPremium"))
32927
32992
  if (!(message.gasPremium && typeof message.gasPremium.length === "number" || $util.isString(message.gasPremium)))
32928
32993
  return "gasPremium: buffer expected";
32994
+ if (message.params != null && message.hasOwnProperty("params"))
32995
+ if (!(message.params && typeof message.params.length === "number" || $util.isString(message.params)))
32996
+ return "params: buffer expected";
32997
+ if (message.derivation != null && message.hasOwnProperty("derivation"))
32998
+ switch (message.derivation) {
32999
+ default:
33000
+ return "derivation: enum value expected";
33001
+ case 0:
33002
+ case 1:
33003
+ break;
33004
+ }
32929
33005
  return null;
32930
33006
  };
32931
33007
 
@@ -32981,6 +33057,21 @@
32981
33057
  $util.base64.decode(object.gasPremium, message.gasPremium = $util.newBuffer($util.base64.length(object.gasPremium)), 0);
32982
33058
  else if (object.gasPremium.length)
32983
33059
  message.gasPremium = object.gasPremium;
33060
+ if (object.params != null)
33061
+ if (typeof object.params === "string")
33062
+ $util.base64.decode(object.params, message.params = $util.newBuffer($util.base64.length(object.params)), 0);
33063
+ else if (object.params.length)
33064
+ message.params = object.params;
33065
+ switch (object.derivation) {
33066
+ case "SECP256K1":
33067
+ case 0:
33068
+ message.derivation = 0;
33069
+ break;
33070
+ case "DELEGATED":
33071
+ case 1:
33072
+ message.derivation = 1;
33073
+ break;
33074
+ }
32984
33075
  return message;
32985
33076
  };
32986
33077
 
@@ -33037,6 +33128,14 @@
33037
33128
  if (options.bytes !== Array)
33038
33129
  object.gasPremium = $util.newBuffer(object.gasPremium);
33039
33130
  }
33131
+ if (options.bytes === String)
33132
+ object.params = "";
33133
+ else {
33134
+ object.params = [];
33135
+ if (options.bytes !== Array)
33136
+ object.params = $util.newBuffer(object.params);
33137
+ }
33138
+ object.derivation = options.enums === String ? "SECP256K1" : 0;
33040
33139
  }
33041
33140
  if (message.privateKey != null && message.hasOwnProperty("privateKey"))
33042
33141
  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;
@@ -33058,6 +33157,10 @@
33058
33157
  object.gasFeeCap = options.bytes === String ? $util.base64.encode(message.gasFeeCap, 0, message.gasFeeCap.length) : options.bytes === Array ? Array.prototype.slice.call(message.gasFeeCap) : message.gasFeeCap;
33059
33158
  if (message.gasPremium != null && message.hasOwnProperty("gasPremium"))
33060
33159
  object.gasPremium = options.bytes === String ? $util.base64.encode(message.gasPremium, 0, message.gasPremium.length) : options.bytes === Array ? Array.prototype.slice.call(message.gasPremium) : message.gasPremium;
33160
+ if (message.params != null && message.hasOwnProperty("params"))
33161
+ object.params = options.bytes === String ? $util.base64.encode(message.params, 0, message.params.length) : options.bytes === Array ? Array.prototype.slice.call(message.params) : message.params;
33162
+ if (message.derivation != null && message.hasOwnProperty("derivation"))
33163
+ object.derivation = options.enums === String ? $root.TW.Filecoin.Proto.DerivationType[message.derivation] : message.derivation;
33061
33164
  return object;
33062
33165
  };
33063
33166
 
@@ -33082,6 +33185,7 @@
33082
33185
  * @memberof TW.Filecoin.Proto
33083
33186
  * @interface ISigningOutput
33084
33187
  * @property {string|null} [json] SigningOutput json
33188
+ * @property {string|null} [errorMessage] SigningOutput errorMessage
33085
33189
  */
33086
33190
 
33087
33191
  /**
@@ -33107,6 +33211,14 @@
33107
33211
  */
33108
33212
  SigningOutput.prototype.json = "";
33109
33213
 
33214
+ /**
33215
+ * SigningOutput errorMessage.
33216
+ * @member {string} errorMessage
33217
+ * @memberof TW.Filecoin.Proto.SigningOutput
33218
+ * @instance
33219
+ */
33220
+ SigningOutput.prototype.errorMessage = "";
33221
+
33110
33222
  /**
33111
33223
  * Creates a new SigningOutput instance using the specified properties.
33112
33224
  * @function create
@@ -33133,6 +33245,8 @@
33133
33245
  writer = $Writer.create();
33134
33246
  if (message.json != null && Object.hasOwnProperty.call(message, "json"))
33135
33247
  writer.uint32(/* id 1, wireType 2 =*/10).string(message.json);
33248
+ if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage"))
33249
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.errorMessage);
33136
33250
  return writer;
33137
33251
  };
33138
33252
 
@@ -33157,6 +33271,9 @@
33157
33271
  case 1:
33158
33272
  message.json = reader.string();
33159
33273
  break;
33274
+ case 2:
33275
+ message.errorMessage = reader.string();
33276
+ break;
33160
33277
  default:
33161
33278
  reader.skipType(tag & 7);
33162
33279
  break;
@@ -33179,6 +33296,9 @@
33179
33296
  if (message.json != null && message.hasOwnProperty("json"))
33180
33297
  if (!$util.isString(message.json))
33181
33298
  return "json: string expected";
33299
+ if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
33300
+ if (!$util.isString(message.errorMessage))
33301
+ return "errorMessage: string expected";
33182
33302
  return null;
33183
33303
  };
33184
33304
 
@@ -33196,6 +33316,8 @@
33196
33316
  var message = new $root.TW.Filecoin.Proto.SigningOutput();
33197
33317
  if (object.json != null)
33198
33318
  message.json = String(object.json);
33319
+ if (object.errorMessage != null)
33320
+ message.errorMessage = String(object.errorMessage);
33199
33321
  return message;
33200
33322
  };
33201
33323
 
@@ -33212,10 +33334,14 @@
33212
33334
  if (!options)
33213
33335
  options = {};
33214
33336
  var object = {};
33215
- if (options.defaults)
33337
+ if (options.defaults) {
33216
33338
  object.json = "";
33339
+ object.errorMessage = "";
33340
+ }
33217
33341
  if (message.json != null && message.hasOwnProperty("json"))
33218
33342
  object.json = message.json;
33343
+ if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
33344
+ object.errorMessage = message.errorMessage;
33219
33345
  return object;
33220
33346
  };
33221
33347
 
@@ -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,w):w+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={653092:()=>{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";}}},653814:()=>g.ea()};function bb(a){for(;0<a.length;)a.shift()(g)}
37
+ var Za,$a,ab={653924:()=>{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";}}},654646:()=>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
@@ -84,6 +84,7 @@ export class AnyAddress {
84
84
  static createWithPublicKeyDerivation(publicKey: PublicKey, coin: CoinType, derivation: Derivation): AnyAddress;
85
85
  static createBech32WithPublicKey(publicKey: PublicKey, coin: CoinType, hrp: string): AnyAddress;
86
86
  static createSS58WithPublicKey(publicKey: PublicKey, coin: CoinType, ss58Prefix: number): AnyAddress;
87
+ static createWithPublicKeyFilecoinAddressType(publicKey: PublicKey, filecoinAddressType: FilecoinAddressType): AnyAddress;
87
88
  description(): string;
88
89
  coin(): CoinType;
89
90
  data(): Uint8Array;
@@ -314,6 +315,7 @@ export class CoinType {
314
315
  static agoric: CoinType;
315
316
  static ton: CoinType;
316
317
  static sui: CoinType;
318
+ static stargaze: CoinType;
317
319
  static polygonzkEVM: CoinType;
318
320
  }
319
321
  export class CoinTypeConfiguration {
@@ -495,6 +497,15 @@ export class FIOAccount {
495
497
  description(): string;
496
498
  delete(): void;
497
499
  }
500
+ export class FilecoinAddressConverter {
501
+ static convertToEthereum(filecoinAddress: string): string;
502
+ static convertFromEthereum(ethAddress: string): string;
503
+ }
504
+ export class FilecoinAddressType {
505
+ value: number;
506
+ static default: FilecoinAddressType;
507
+ static delegated: FilecoinAddressType;
508
+ }
498
509
  export class GroestlcoinAddress {
499
510
  static equal(lhs: GroestlcoinAddress, rhs: GroestlcoinAddress): boolean;
500
511
  static isValidString(string: string): boolean;
@@ -579,6 +590,7 @@ export class HRP {
579
590
  static nativeInjective: HRP;
580
591
  static osmosis: HRP;
581
592
  static terraV2: HRP;
593
+ static stargaze: HRP;
582
594
  static nativeEvmos: HRP;
583
595
  }
584
596
 
@@ -846,6 +858,8 @@ export interface WalletCore {
846
858
  EthereumChainID: typeof EthereumChainID;
847
859
  EthereumMessageSigner: typeof EthereumMessageSigner;
848
860
  FIOAccount: typeof FIOAccount;
861
+ FilecoinAddressConverter: typeof FilecoinAddressConverter;
862
+ FilecoinAddressType: typeof FilecoinAddressType;
849
863
  GroestlcoinAddress: typeof GroestlcoinAddress;
850
864
  HDVersion: typeof HDVersion;
851
865
  HDWallet: typeof HDWallet;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustwallet/wallet-core",
3
- "version": "3.1.21",
3
+ "version": "3.1.23",
4
4
  "description": "wallet core wasm and protobuf models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",