@trustwallet/wallet-core 4.1.5 → 4.1.6
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.
@@ -24587,7 +24587,7 @@ export namespace TW {
|
|
24587
24587
|
|
24588
24588
|
/** Coin enum. */
|
24589
24589
|
enum Coin {
|
24590
|
-
|
24590
|
+
POL = 0,
|
24591
24591
|
ATOM = 1,
|
24592
24592
|
BNB = 2,
|
24593
24593
|
APT = 3,
|
@@ -40637,7 +40637,8 @@ export namespace TW {
|
|
40637
40637
|
enum WalletVersion {
|
40638
40638
|
WALLET_V3_R1 = 0,
|
40639
40639
|
WALLET_V3_R2 = 1,
|
40640
|
-
WALLET_V4_R2 = 2
|
40640
|
+
WALLET_V4_R2 = 2,
|
40641
|
+
WALLET_V5_R1 = 3
|
40641
40642
|
}
|
40642
40643
|
|
40643
40644
|
/** SendMode enum. */
|
@@ -40653,9 +40654,6 @@ export namespace TW {
|
|
40653
40654
|
/** Properties of a Transfer. */
|
40654
40655
|
interface ITransfer {
|
40655
40656
|
|
40656
|
-
/** Transfer walletVersion */
|
40657
|
-
walletVersion?: (TW.TheOpenNetwork.Proto.WalletVersion|null);
|
40658
|
-
|
40659
40657
|
/** Transfer dest */
|
40660
40658
|
dest?: (string|null);
|
40661
40659
|
|
@@ -40687,9 +40685,6 @@ export namespace TW {
|
|
40687
40685
|
*/
|
40688
40686
|
constructor(properties?: TW.TheOpenNetwork.Proto.ITransfer);
|
40689
40687
|
|
40690
|
-
/** Transfer walletVersion. */
|
40691
|
-
public walletVersion: TW.TheOpenNetwork.Proto.WalletVersion;
|
40692
|
-
|
40693
40688
|
/** Transfer dest. */
|
40694
40689
|
public dest: string;
|
40695
40690
|
|
@@ -40961,6 +40956,9 @@ export namespace TW {
|
|
40961
40956
|
|
40962
40957
|
/** SigningInput expireAt */
|
40963
40958
|
expireAt?: (number|null);
|
40959
|
+
|
40960
|
+
/** SigningInput walletVersion */
|
40961
|
+
walletVersion?: (TW.TheOpenNetwork.Proto.WalletVersion|null);
|
40964
40962
|
}
|
40965
40963
|
|
40966
40964
|
/** Represents a SigningInput. */
|
@@ -40987,6 +40985,9 @@ export namespace TW {
|
|
40987
40985
|
/** SigningInput expireAt. */
|
40988
40986
|
public expireAt: number;
|
40989
40987
|
|
40988
|
+
/** SigningInput walletVersion. */
|
40989
|
+
public walletVersion: TW.TheOpenNetwork.Proto.WalletVersion;
|
40990
|
+
|
40990
40991
|
/**
|
40991
40992
|
* Creates a new SigningInput instance using the specified properties.
|
40992
40993
|
* @param [properties] Properties to set
|
@@ -73354,7 +73354,7 @@
|
|
73354
73354
|
* Coin enum.
|
73355
73355
|
* @name TW.LiquidStaking.Proto.Coin
|
73356
73356
|
* @enum {number}
|
73357
|
-
* @property {number}
|
73357
|
+
* @property {number} POL=0 POL value
|
73358
73358
|
* @property {number} ATOM=1 ATOM value
|
73359
73359
|
* @property {number} BNB=2 BNB value
|
73360
73360
|
* @property {number} APT=3 APT value
|
@@ -73362,7 +73362,7 @@
|
|
73362
73362
|
*/
|
73363
73363
|
Proto.Coin = (function() {
|
73364
73364
|
var valuesById = {}, values = Object.create(valuesById);
|
73365
|
-
values[valuesById[0] = "
|
73365
|
+
values[valuesById[0] = "POL"] = 0;
|
73366
73366
|
values[valuesById[1] = "ATOM"] = 1;
|
73367
73367
|
values[valuesById[2] = "BNB"] = 2;
|
73368
73368
|
values[valuesById[3] = "APT"] = 3;
|
@@ -73823,7 +73823,7 @@
|
|
73823
73823
|
return object;
|
73824
73824
|
var message = new $root.TW.LiquidStaking.Proto.Asset();
|
73825
73825
|
switch (object.stakingToken) {
|
73826
|
-
case "
|
73826
|
+
case "POL":
|
73827
73827
|
case 0:
|
73828
73828
|
message.stakingToken = 0;
|
73829
73829
|
break;
|
@@ -73867,7 +73867,7 @@
|
|
73867
73867
|
options = {};
|
73868
73868
|
var object = {};
|
73869
73869
|
if (options.defaults) {
|
73870
|
-
object.stakingToken = options.enums === String ? "
|
73870
|
+
object.stakingToken = options.enums === String ? "POL" : 0;
|
73871
73871
|
object.liquidToken = "";
|
73872
73872
|
object.denom = "";
|
73873
73873
|
object.fromAddress = "";
|
@@ -120102,12 +120102,14 @@
|
|
120102
120102
|
* @property {number} WALLET_V3_R1=0 WALLET_V3_R1 value
|
120103
120103
|
* @property {number} WALLET_V3_R2=1 WALLET_V3_R2 value
|
120104
120104
|
* @property {number} WALLET_V4_R2=2 WALLET_V4_R2 value
|
120105
|
+
* @property {number} WALLET_V5_R1=3 WALLET_V5_R1 value
|
120105
120106
|
*/
|
120106
120107
|
Proto.WalletVersion = (function() {
|
120107
120108
|
var valuesById = {}, values = Object.create(valuesById);
|
120108
120109
|
values[valuesById[0] = "WALLET_V3_R1"] = 0;
|
120109
120110
|
values[valuesById[1] = "WALLET_V3_R2"] = 1;
|
120110
120111
|
values[valuesById[2] = "WALLET_V4_R2"] = 2;
|
120112
|
+
values[valuesById[3] = "WALLET_V5_R1"] = 3;
|
120111
120113
|
return values;
|
120112
120114
|
})();
|
120113
120115
|
|
@@ -120139,7 +120141,6 @@
|
|
120139
120141
|
* Properties of a Transfer.
|
120140
120142
|
* @memberof TW.TheOpenNetwork.Proto
|
120141
120143
|
* @interface ITransfer
|
120142
|
-
* @property {TW.TheOpenNetwork.Proto.WalletVersion|null} [walletVersion] Transfer walletVersion
|
120143
120144
|
* @property {string|null} [dest] Transfer dest
|
120144
120145
|
* @property {Long|null} [amount] Transfer amount
|
120145
120146
|
* @property {number|null} [mode] Transfer mode
|
@@ -120164,14 +120165,6 @@
|
|
120164
120165
|
this[keys[i]] = properties[keys[i]];
|
120165
120166
|
}
|
120166
120167
|
|
120167
|
-
/**
|
120168
|
-
* Transfer walletVersion.
|
120169
|
-
* @member {TW.TheOpenNetwork.Proto.WalletVersion} walletVersion
|
120170
|
-
* @memberof TW.TheOpenNetwork.Proto.Transfer
|
120171
|
-
* @instance
|
120172
|
-
*/
|
120173
|
-
Transfer.prototype.walletVersion = 0;
|
120174
|
-
|
120175
120168
|
/**
|
120176
120169
|
* Transfer dest.
|
120177
120170
|
* @member {string} dest
|
@@ -120266,22 +120259,20 @@
|
|
120266
120259
|
Transfer.encode = function encode(message, writer) {
|
120267
120260
|
if (!writer)
|
120268
120261
|
writer = $Writer.create();
|
120269
|
-
if (message.walletVersion != null && Object.hasOwnProperty.call(message, "walletVersion"))
|
120270
|
-
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.walletVersion);
|
120271
120262
|
if (message.dest != null && Object.hasOwnProperty.call(message, "dest"))
|
120272
|
-
writer.uint32(/* id
|
120263
|
+
writer.uint32(/* id 1, wireType 2 =*/10).string(message.dest);
|
120273
120264
|
if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
|
120274
|
-
writer.uint32(/* id
|
120265
|
+
writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.amount);
|
120275
120266
|
if (message.mode != null && Object.hasOwnProperty.call(message, "mode"))
|
120276
|
-
writer.uint32(/* id
|
120267
|
+
writer.uint32(/* id 3, wireType 0 =*/24).uint32(message.mode);
|
120277
120268
|
if (message.comment != null && Object.hasOwnProperty.call(message, "comment"))
|
120278
|
-
writer.uint32(/* id
|
120269
|
+
writer.uint32(/* id 4, wireType 2 =*/34).string(message.comment);
|
120279
120270
|
if (message.bounceable != null && Object.hasOwnProperty.call(message, "bounceable"))
|
120280
|
-
writer.uint32(/* id
|
120271
|
+
writer.uint32(/* id 5, wireType 0 =*/40).bool(message.bounceable);
|
120281
120272
|
if (message.jettonTransfer != null && Object.hasOwnProperty.call(message, "jettonTransfer"))
|
120282
|
-
$root.TW.TheOpenNetwork.Proto.JettonTransfer.encode(message.jettonTransfer, writer.uint32(/* id
|
120273
|
+
$root.TW.TheOpenNetwork.Proto.JettonTransfer.encode(message.jettonTransfer, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
|
120283
120274
|
if (message.customPayload != null && Object.hasOwnProperty.call(message, "customPayload"))
|
120284
|
-
$root.TW.TheOpenNetwork.Proto.CustomPayload.encode(message.customPayload, writer.uint32(/* id
|
120275
|
+
$root.TW.TheOpenNetwork.Proto.CustomPayload.encode(message.customPayload, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
|
120285
120276
|
return writer;
|
120286
120277
|
};
|
120287
120278
|
|
@@ -120304,27 +120295,24 @@
|
|
120304
120295
|
var tag = reader.uint32();
|
120305
120296
|
switch (tag >>> 3) {
|
120306
120297
|
case 1:
|
120307
|
-
message.walletVersion = reader.int32();
|
120308
|
-
break;
|
120309
|
-
case 2:
|
120310
120298
|
message.dest = reader.string();
|
120311
120299
|
break;
|
120312
|
-
case
|
120300
|
+
case 2:
|
120313
120301
|
message.amount = reader.uint64();
|
120314
120302
|
break;
|
120315
|
-
case
|
120303
|
+
case 3:
|
120316
120304
|
message.mode = reader.uint32();
|
120317
120305
|
break;
|
120318
|
-
case
|
120306
|
+
case 4:
|
120319
120307
|
message.comment = reader.string();
|
120320
120308
|
break;
|
120321
|
-
case
|
120309
|
+
case 5:
|
120322
120310
|
message.bounceable = reader.bool();
|
120323
120311
|
break;
|
120324
|
-
case
|
120312
|
+
case 6:
|
120325
120313
|
message.jettonTransfer = $root.TW.TheOpenNetwork.Proto.JettonTransfer.decode(reader, reader.uint32());
|
120326
120314
|
break;
|
120327
|
-
case
|
120315
|
+
case 7:
|
120328
120316
|
message.customPayload = $root.TW.TheOpenNetwork.Proto.CustomPayload.decode(reader, reader.uint32());
|
120329
120317
|
break;
|
120330
120318
|
default:
|
@@ -120347,15 +120335,6 @@
|
|
120347
120335
|
if (typeof message !== "object" || message === null)
|
120348
120336
|
return "object expected";
|
120349
120337
|
var properties = {};
|
120350
|
-
if (message.walletVersion != null && message.hasOwnProperty("walletVersion"))
|
120351
|
-
switch (message.walletVersion) {
|
120352
|
-
default:
|
120353
|
-
return "walletVersion: enum value expected";
|
120354
|
-
case 0:
|
120355
|
-
case 1:
|
120356
|
-
case 2:
|
120357
|
-
break;
|
120358
|
-
}
|
120359
120338
|
if (message.dest != null && message.hasOwnProperty("dest"))
|
120360
120339
|
if (!$util.isString(message.dest))
|
120361
120340
|
return "dest: string expected";
|
@@ -120404,20 +120383,6 @@
|
|
120404
120383
|
if (object instanceof $root.TW.TheOpenNetwork.Proto.Transfer)
|
120405
120384
|
return object;
|
120406
120385
|
var message = new $root.TW.TheOpenNetwork.Proto.Transfer();
|
120407
|
-
switch (object.walletVersion) {
|
120408
|
-
case "WALLET_V3_R1":
|
120409
|
-
case 0:
|
120410
|
-
message.walletVersion = 0;
|
120411
|
-
break;
|
120412
|
-
case "WALLET_V3_R2":
|
120413
|
-
case 1:
|
120414
|
-
message.walletVersion = 1;
|
120415
|
-
break;
|
120416
|
-
case "WALLET_V4_R2":
|
120417
|
-
case 2:
|
120418
|
-
message.walletVersion = 2;
|
120419
|
-
break;
|
120420
|
-
}
|
120421
120386
|
if (object.dest != null)
|
120422
120387
|
message.dest = String(object.dest);
|
120423
120388
|
if (object.amount != null)
|
@@ -120462,7 +120427,6 @@
|
|
120462
120427
|
options = {};
|
120463
120428
|
var object = {};
|
120464
120429
|
if (options.defaults) {
|
120465
|
-
object.walletVersion = options.enums === String ? "WALLET_V3_R1" : 0;
|
120466
120430
|
object.dest = "";
|
120467
120431
|
if ($util.Long) {
|
120468
120432
|
var long = new $util.Long(0, 0, true);
|
@@ -120473,8 +120437,6 @@
|
|
120473
120437
|
object.comment = "";
|
120474
120438
|
object.bounceable = false;
|
120475
120439
|
}
|
120476
|
-
if (message.walletVersion != null && message.hasOwnProperty("walletVersion"))
|
120477
|
-
object.walletVersion = options.enums === String ? $root.TW.TheOpenNetwork.Proto.WalletVersion[message.walletVersion] : message.walletVersion;
|
120478
120440
|
if (message.dest != null && message.hasOwnProperty("dest"))
|
120479
120441
|
object.dest = message.dest;
|
120480
120442
|
if (message.amount != null && message.hasOwnProperty("amount"))
|
@@ -120996,6 +120958,7 @@
|
|
120996
120958
|
* @property {Array.<TW.TheOpenNetwork.Proto.ITransfer>|null} [messages] SigningInput messages
|
120997
120959
|
* @property {number|null} [sequenceNumber] SigningInput sequenceNumber
|
120998
120960
|
* @property {number|null} [expireAt] SigningInput expireAt
|
120961
|
+
* @property {TW.TheOpenNetwork.Proto.WalletVersion|null} [walletVersion] SigningInput walletVersion
|
120999
120962
|
*/
|
121000
120963
|
|
121001
120964
|
/**
|
@@ -121054,6 +121017,14 @@
|
|
121054
121017
|
*/
|
121055
121018
|
SigningInput.prototype.expireAt = 0;
|
121056
121019
|
|
121020
|
+
/**
|
121021
|
+
* SigningInput walletVersion.
|
121022
|
+
* @member {TW.TheOpenNetwork.Proto.WalletVersion} walletVersion
|
121023
|
+
* @memberof TW.TheOpenNetwork.Proto.SigningInput
|
121024
|
+
* @instance
|
121025
|
+
*/
|
121026
|
+
SigningInput.prototype.walletVersion = 0;
|
121027
|
+
|
121057
121028
|
/**
|
121058
121029
|
* Creates a new SigningInput instance using the specified properties.
|
121059
121030
|
* @function create
|
@@ -121089,6 +121060,8 @@
|
|
121089
121060
|
writer.uint32(/* id 4, wireType 0 =*/32).uint32(message.sequenceNumber);
|
121090
121061
|
if (message.expireAt != null && Object.hasOwnProperty.call(message, "expireAt"))
|
121091
121062
|
writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.expireAt);
|
121063
|
+
if (message.walletVersion != null && Object.hasOwnProperty.call(message, "walletVersion"))
|
121064
|
+
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.walletVersion);
|
121092
121065
|
return writer;
|
121093
121066
|
};
|
121094
121067
|
|
@@ -121127,6 +121100,9 @@
|
|
121127
121100
|
case 5:
|
121128
121101
|
message.expireAt = reader.uint32();
|
121129
121102
|
break;
|
121103
|
+
case 6:
|
121104
|
+
message.walletVersion = reader.int32();
|
121105
|
+
break;
|
121130
121106
|
default:
|
121131
121107
|
reader.skipType(tag & 7);
|
121132
121108
|
break;
|
@@ -121167,6 +121143,16 @@
|
|
121167
121143
|
if (message.expireAt != null && message.hasOwnProperty("expireAt"))
|
121168
121144
|
if (!$util.isInteger(message.expireAt))
|
121169
121145
|
return "expireAt: integer expected";
|
121146
|
+
if (message.walletVersion != null && message.hasOwnProperty("walletVersion"))
|
121147
|
+
switch (message.walletVersion) {
|
121148
|
+
default:
|
121149
|
+
return "walletVersion: enum value expected";
|
121150
|
+
case 0:
|
121151
|
+
case 1:
|
121152
|
+
case 2:
|
121153
|
+
case 3:
|
121154
|
+
break;
|
121155
|
+
}
|
121170
121156
|
return null;
|
121171
121157
|
};
|
121172
121158
|
|
@@ -121206,6 +121192,24 @@
|
|
121206
121192
|
message.sequenceNumber = object.sequenceNumber >>> 0;
|
121207
121193
|
if (object.expireAt != null)
|
121208
121194
|
message.expireAt = object.expireAt >>> 0;
|
121195
|
+
switch (object.walletVersion) {
|
121196
|
+
case "WALLET_V3_R1":
|
121197
|
+
case 0:
|
121198
|
+
message.walletVersion = 0;
|
121199
|
+
break;
|
121200
|
+
case "WALLET_V3_R2":
|
121201
|
+
case 1:
|
121202
|
+
message.walletVersion = 1;
|
121203
|
+
break;
|
121204
|
+
case "WALLET_V4_R2":
|
121205
|
+
case 2:
|
121206
|
+
message.walletVersion = 2;
|
121207
|
+
break;
|
121208
|
+
case "WALLET_V5_R1":
|
121209
|
+
case 3:
|
121210
|
+
message.walletVersion = 3;
|
121211
|
+
break;
|
121212
|
+
}
|
121209
121213
|
return message;
|
121210
121214
|
};
|
121211
121215
|
|
@@ -121241,6 +121245,7 @@
|
|
121241
121245
|
}
|
121242
121246
|
object.sequenceNumber = 0;
|
121243
121247
|
object.expireAt = 0;
|
121248
|
+
object.walletVersion = options.enums === String ? "WALLET_V3_R1" : 0;
|
121244
121249
|
}
|
121245
121250
|
if (message.privateKey != null && message.hasOwnProperty("privateKey"))
|
121246
121251
|
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;
|
@@ -121255,6 +121260,8 @@
|
|
121255
121260
|
object.sequenceNumber = message.sequenceNumber;
|
121256
121261
|
if (message.expireAt != null && message.hasOwnProperty("expireAt"))
|
121257
121262
|
object.expireAt = message.expireAt;
|
121263
|
+
if (message.walletVersion != null && message.hasOwnProperty("walletVersion"))
|
121264
|
+
object.walletVersion = options.enums === String ? $root.TW.TheOpenNetwork.Proto.WalletVersion[message.walletVersion] : message.walletVersion;
|
121258
121265
|
return object;
|
121259
121266
|
};
|
121260
121267
|
|
package/dist/lib/wallet-core.js
CHANGED
@@ -34,7 +34,7 @@ function Ra(){H++;g.monitorRunDependencies&&g.monitorRunDependencies(H);assert(!
|
|
34
34
|
function Sa(){return K.startsWith("data:application/octet-stream;base64,")}function ma(a){return a.startsWith("file://")}function M(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&&!ma(K))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={
|
37
|
+
var Wa,Xa,Ya={2064404:()=>{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";}}},2065126:()=>g.ea()};function Za(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){$a||($a={});$a[a]||($a[a]=1,v&&(a="warning: "+a),y(a))}var $a;function ab(a){this.l=a-24;this.Na=function(b){G[this.l+4>>2]=b};this.Ia=function(b){G[this.l+8>>2]=b};this.Ja=function(){F[this.l>>2]=0};this.Ea=function(){D[this.l+12>>0]=0};this.Ka=function(){D[this.l+13>>0]=0};this.I=function(b,c){this.Da();this.Na(b);this.Ia(c);this.Ja();this.Ea();this.Ka()};this.Da=function(){G[this.l+16>>2]=0}}
|
39
39
|
var bb=0,cb=(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},db=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=cb(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},eb=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},fb=
|
40
40
|
a=>{if("/"===a)return"/";a=db(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)};
|
Binary file
|