@trustwallet/wallet-core 3.1.3 → 3.1.4

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.
@@ -26634,8 +26634,8 @@ export namespace TW {
26634
26634
  /** Properties of a SwapInput. */
26635
26635
  interface ISwapInput {
26636
26636
 
26637
- /** SwapInput fromChain */
26638
- fromChain?: (TW.THORChainSwap.Proto.Chain|null);
26637
+ /** SwapInput fromAsset */
26638
+ fromAsset?: (TW.THORChainSwap.Proto.IAsset|null);
26639
26639
 
26640
26640
  /** SwapInput fromAddress */
26641
26641
  fromAddress?: (string|null);
@@ -26677,8 +26677,8 @@ export namespace TW {
26677
26677
  */
26678
26678
  constructor(properties?: TW.THORChainSwap.Proto.ISwapInput);
26679
26679
 
26680
- /** SwapInput fromChain. */
26681
- public fromChain: TW.THORChainSwap.Proto.Chain;
26680
+ /** SwapInput fromAsset. */
26681
+ public fromAsset?: (TW.THORChainSwap.Proto.IAsset|null);
26682
26682
 
26683
26683
  /** SwapInput fromAddress. */
26684
26684
  public fromAddress: string;
@@ -76386,7 +76386,7 @@
76386
76386
  * Properties of a SwapInput.
76387
76387
  * @memberof TW.THORChainSwap.Proto
76388
76388
  * @interface ISwapInput
76389
- * @property {TW.THORChainSwap.Proto.Chain|null} [fromChain] SwapInput fromChain
76389
+ * @property {TW.THORChainSwap.Proto.IAsset|null} [fromAsset] SwapInput fromAsset
76390
76390
  * @property {string|null} [fromAddress] SwapInput fromAddress
76391
76391
  * @property {TW.THORChainSwap.Proto.IAsset|null} [toAsset] SwapInput toAsset
76392
76392
  * @property {string|null} [toAddress] SwapInput toAddress
@@ -76415,12 +76415,12 @@
76415
76415
  }
76416
76416
 
76417
76417
  /**
76418
- * SwapInput fromChain.
76419
- * @member {TW.THORChainSwap.Proto.Chain} fromChain
76418
+ * SwapInput fromAsset.
76419
+ * @member {TW.THORChainSwap.Proto.IAsset|null|undefined} fromAsset
76420
76420
  * @memberof TW.THORChainSwap.Proto.SwapInput
76421
76421
  * @instance
76422
76422
  */
76423
- SwapInput.prototype.fromChain = 0;
76423
+ SwapInput.prototype.fromAsset = null;
76424
76424
 
76425
76425
  /**
76426
76426
  * SwapInput fromAddress.
@@ -76526,8 +76526,8 @@
76526
76526
  SwapInput.encode = function encode(message, writer) {
76527
76527
  if (!writer)
76528
76528
  writer = $Writer.create();
76529
- if (message.fromChain != null && Object.hasOwnProperty.call(message, "fromChain"))
76530
- writer.uint32(/* id 1, wireType 0 =*/8).int32(message.fromChain);
76529
+ if (message.fromAsset != null && Object.hasOwnProperty.call(message, "fromAsset"))
76530
+ $root.TW.THORChainSwap.Proto.Asset.encode(message.fromAsset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
76531
76531
  if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress"))
76532
76532
  writer.uint32(/* id 2, wireType 2 =*/18).string(message.fromAddress);
76533
76533
  if (message.toAsset != null && Object.hasOwnProperty.call(message, "toAsset"))
@@ -76570,7 +76570,7 @@
76570
76570
  var tag = reader.uint32();
76571
76571
  switch (tag >>> 3) {
76572
76572
  case 1:
76573
- message.fromChain = reader.int32();
76573
+ message.fromAsset = $root.TW.THORChainSwap.Proto.Asset.decode(reader, reader.uint32());
76574
76574
  break;
76575
76575
  case 2:
76576
76576
  message.fromAddress = reader.string();
@@ -76621,16 +76621,11 @@
76621
76621
  SwapInput.verify = function verify(message) {
76622
76622
  if (typeof message !== "object" || message === null)
76623
76623
  return "object expected";
76624
- if (message.fromChain != null && message.hasOwnProperty("fromChain"))
76625
- switch (message.fromChain) {
76626
- default:
76627
- return "fromChain: enum value expected";
76628
- case 0:
76629
- case 1:
76630
- case 2:
76631
- case 3:
76632
- break;
76633
- }
76624
+ if (message.fromAsset != null && message.hasOwnProperty("fromAsset")) {
76625
+ var error = $root.TW.THORChainSwap.Proto.Asset.verify(message.fromAsset);
76626
+ if (error)
76627
+ return "fromAsset." + error;
76628
+ }
76634
76629
  if (message.fromAddress != null && message.hasOwnProperty("fromAddress"))
76635
76630
  if (!$util.isString(message.fromAddress))
76636
76631
  return "fromAddress: string expected";
@@ -76678,23 +76673,10 @@
76678
76673
  if (object instanceof $root.TW.THORChainSwap.Proto.SwapInput)
76679
76674
  return object;
76680
76675
  var message = new $root.TW.THORChainSwap.Proto.SwapInput();
76681
- switch (object.fromChain) {
76682
- case "THOR":
76683
- case 0:
76684
- message.fromChain = 0;
76685
- break;
76686
- case "BTC":
76687
- case 1:
76688
- message.fromChain = 1;
76689
- break;
76690
- case "ETH":
76691
- case 2:
76692
- message.fromChain = 2;
76693
- break;
76694
- case "BNB":
76695
- case 3:
76696
- message.fromChain = 3;
76697
- break;
76676
+ if (object.fromAsset != null) {
76677
+ if (typeof object.fromAsset !== "object")
76678
+ throw TypeError(".TW.THORChainSwap.Proto.SwapInput.fromAsset: object expected");
76679
+ message.fromAsset = $root.TW.THORChainSwap.Proto.Asset.fromObject(object.fromAsset);
76698
76680
  }
76699
76681
  if (object.fromAddress != null)
76700
76682
  message.fromAddress = String(object.fromAddress);
@@ -76736,7 +76718,7 @@
76736
76718
  options = {};
76737
76719
  var object = {};
76738
76720
  if (options.defaults) {
76739
- object.fromChain = options.enums === String ? "THOR" : 0;
76721
+ object.fromAsset = null;
76740
76722
  object.fromAddress = "";
76741
76723
  object.toAsset = null;
76742
76724
  object.toAddress = "";
@@ -76748,8 +76730,8 @@
76748
76730
  object.affiliateFeeRateBp = "";
76749
76731
  object.extraMemo = "";
76750
76732
  }
76751
- if (message.fromChain != null && message.hasOwnProperty("fromChain"))
76752
- object.fromChain = options.enums === String ? $root.TW.THORChainSwap.Proto.Chain[message.fromChain] : message.fromChain;
76733
+ if (message.fromAsset != null && message.hasOwnProperty("fromAsset"))
76734
+ object.fromAsset = $root.TW.THORChainSwap.Proto.Asset.toObject(message.fromAsset, options);
76753
76735
  if (message.fromAddress != null && message.hasOwnProperty("fromAddress"))
76754
76736
  object.fromAddress = message.fromAddress;
76755
76737
  if (message.toAsset != null && message.hasOwnProperty("toAsset"))
@@ -34,7 +34,7 @@ function Ra(){I++;g.monitorRunDependencies&&g.monitorRunDependencies(I);assert(!
34
34
  function Sa(){return K.startsWith("data:application/octet-stream;base64,")}function L(a){return function(){var b=g.asm;assert(Na,"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 K;K="wallet-core.wasm";if(!Sa()){var Ta=K;K=g.locateFile?g.locateFile(Ta,x):x+Ta}
35
35
  function Ua(){var a=K;try{if(a==K&&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 Va(){if(!qa&&(ea||fa)){if("function"==typeof fetch&&!K.startsWith("file://"))return fetch(K,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+K+"'";return a.arrayBuffer()}).catch(function(){return Ua()});if(ja)return new Promise(function(a,b){ja(K,function(c){a(new Uint8Array(c))},b)})}return Promise.resolve().then(function(){return Ua()})}
37
- var Wa,Xa,Ya={563572:()=>{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";}}},564294:()=>g.ea()};function Za(a){for(;0<a.length;)a.shift()(g)}
37
+ var Wa,Xa,Ya={563700:()=>{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";}}},564422:()=>g.ea()};function Za(a){for(;0<a.length;)a.shift()(g)}
38
38
  function $a(a){return a.replace(/\b_Z[\w\d_]+/g,function(b){va("warning: build with -sDEMANGLE_SUPPORT to link in libcxxabi demangling");return b===b?b:b+" ["+b+"]"})}function va(a){ab||(ab={});ab[a]||(ab[a]=1,v&&(a="warning: "+a),y(a))}var ab;function bb(a,b){assert(0<=a.length,"writeArrayToMemory array must have a length (should be an array or typed array)");D.set(a,b)}
39
39
  function cb(a){this.l=a-24;this.Ma=function(b){G[this.l+4>>2]=b};this.Ha=function(b){G[this.l+8>>2]=b};this.Ia=function(){F[this.l>>2]=0};this.Da=function(){D[this.l+12>>0]=0};this.Ja=function(){D[this.l+13>>0]=0};this.I=function(b,c){this.Ca();this.Ma(b);this.Ha(c);this.Ia();this.Da();this.Ja()};this.Ca=function(){G[this.l+16>>2]=0}}
40
40
  var db=0,eb=(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},fb=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=eb(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},gb=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},hb=
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trustwallet/wallet-core",
3
- "version": "3.1.3",
3
+ "version": "3.1.4",
4
4
  "description": "wallet core wasm and protobuf models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",